Source/ Codesnippets | | | | - page 1 - |
| | Horizontaler Splitter avec Xprofan de Andreas Miethe: KompilierenMarqueSéparation#############################
XProfan
#############################
Author : Andreas Miethe
2003
#############################
Thema : Horizontal-Splitter
#############################
SetTrueColor 1
set("FastMode",1)
------------------------
Header-Dateien einbinden
------------------------
$H windows.ph
$H structs.ph
$H messages.ph
------------------------
------------------------
Definitionen
------------------------
DEF HiWord(1) And(&(1)>>16,$FFFF)
DEF LoWord(1) And(&(1),$FFFF)
DEF MakeLong(2) Or(&(1),&(2)<<16)
------------------------
------------------------
Strukturen
------------------------
STRUCT MyWindowClass = ~WndClass
STRUCT MyMsg = ~Msg
STRUCT rect = ~RECT
------------------------
Declare hCursor&,Classname$,WindowTitle$,WindowIcon$
Declare WindowClass#, Msg#, Size#
PROC WindowProc
parameters Wnd&, Msg&, wParam&, lParam&
IF Msg& = ~WM_SIZE
IF HIWORD(lParam&) < dwSplitterPos&
dwSplitterPos& = HIWORD(lParam&)-10
Endif
~MoveWindow(Edit1&, 0, 0, LOWORD(lParam&), dwSplitterPos& , 1)
~MoveWindow(Edit2&, 0, dwSplitterPos&+4, LOWORD(lParam&),HIWORD(lParam&) - dwSplitterPos& -4, 1)
Endif
IF Msg& = ~WM_MOUSEMOVE
Declare rect#
DIM rect#,rect
IF HIWORD(lParam&) > 40
~SetCursor(hCursor&)
IF wParam& = ~MK_LBUTTON
~GetClientRect(Wnd&, rect#)
IF (HIWORD(lParam&) > rect#.bottom& -40)
RETURN 0
ENDIF
dwSplitterPos& = HIWORD(lParam&)
~SendMessage(Wnd&,~WM_SIZE, 0, MAKELONG(rect#.right&, rect#.bottom&))
~UpdateWindow(Edit1&)
~UpdateWindow(Edit2&)
ENDIF
ENDIF
DISPOSE Rect#
ENDIF
IF Msg& = ~WM_LBUTTONDOWN
~SetCursor(hCursor&)
bSplitterMoving& = 1
~SetCapture(Wnd&)
Endif
IF Msg& = ~WM_LBUTTONUP
~ReleaseCapture()
bSplitterMoving& = 0
Endif
IF Msg& = ~WM_CLOSE
~DeleteObject(hCursor&)
Messagebox("und Tschüss !","Ende",64)
~PostQuitMessage(0)
endif
RETURN ~DefWindowProc(Wnd&, Msg&, wParam&, lParam&)
endproc
PROC Main
Declare Ende&,Edit1&,Edit2&,bSplitterMoving&,dwSplitterPos&,Window&
DIM WindowClass#,MyWindowClass
DIM Msg#,MyMsg
Classname$ = "XPrfWndClass"
WindowTitle$ = "H-Splitter"
WindowIcon$ = "A"
WITH WindowClass#
.style& = 0
.lpfnWndProc& = ProcAddr(WindowProc,4)
.cbClsExtra& = 0
.cbWndExtra& = 0
.hInstance& = %HInstance
.hIcon& = ~LoadIcon(%hInstance,Addr(WindowIcon$))
.hCursor& = ~LoadCursor(0, ~IDC_ARROW)
.hbrBackground& = ~CreateSolidBrush(~GetSysColor(~COLOR_BTNFACE))
.lpszMenuName& = Addr(Classname$)
.lpszClassName& = Addr(Classname$)
EndWith
IF ~RegisterClass(WindowClass#) = 0
MessageBox("Fehler beim Registrieren der Anwendung !","Fehler...",16)
End
Endif
Window& = ~CreateWindowEx(
0,
Addr(Classname$),
Addr(WindowTitle$),
~ws_OverlappedWindow,
~cw_UseDefault,
~cw_UseDefault,
640,
480,
0,
0,
%HInstance,
0)
Edit1& = ~CreateWindowEx(~WS_EX_CLIENTEDGE,"edit", 0,OR(OR(OR(OR(~WS_CHILD,~WS_VISIBLE),~WS_CLIPSIBLINGS),~ES_MULTILINE),~WS_VSCROLL),0, 0, width(window&), Height(window&)/2, window&, 1001,%hInstance,0)
Edit2& = ~CreateWindowEx(~WS_EX_CLIENTEDGE,"edit", 0,OR(OR(OR(OR(~WS_CHILD,~WS_VISIBLE),~WS_CLIPSIBLINGS),~ES_MULTILINE),~WS_VSCROLL),0, Height(Edit1&)+6, width(window&), Height(window&)/2, window&, 1002,%hInstance,0)
ClearList
AddFiles "C:\*.*"
MoveListToEdit(Edit1&)
MoveListToEdit(Edit2&)
hCursor& = ~LoadCursor(0,~IDC_SIZENS)
bSplitterMoving& = 0
dwSplitterPos& = (Height(window&)/2) + 4
~ShowWindow(Window&, ~SW_SHOWNORMAL)
~UpdateWindow(Window&)
WHILE ~GetMessage(Msg#, 0, 0, 0) > 0
~TranslateMessage(Msg#)
~DispatchMessage(Msg#)
Endwhile
ENDPROC
Main
Salve, iF |
| | | | |
| | « cette Beitrag wurde comme Solution gekennzeichnet. » | | Jörg Sellmeyer | et repariert...
$I profalt.inc
'#############################
'XProfan
'#############################
'Author : Andreas Miethe
'2003
'#############################
'Thema : Horizontal-Splitter
'#############################
'SetTrueColor 1
set("Fastmode",1)
'------------------------
'En-tête-Fichiers einbinden
'------------------------
$H windows.ph
$H structs.ph
$H messages.ph
'------------------------
'------------------------
'Definitionen
'------------------------
DEF HiWord(1) And(&(1)>>16,$FFFF)
DEF LoWord(1) And(&(1),$FFFF)
DEF MakeLong(2) Or(&(1),&(2)<<16)
'------------------------
'------------------------
'Strukturen
'------------------------
STRUCT MyWindowClass = ~WndClass
STRUCT MyMsg = ~Msg
STRUCT rect = ~RECT
'------------------------
Déclarer hCursor&,Classname$,Titre de la fenêtre$,WindowIcon$
Déclarer WindowClass#, Msg#, Size#
PROC WindowProc
parameters Wnd&, Msg&, wParam&, lParam&
IF Msg& = ~WM_SIZE
IF HIWORD(lParam&) < dwSplitterPos&
dwSplitterPos& = HIWORD(lParam&)-10
Endif
~MoveWindow(Éditer1&, 0, 0, LOWORD(lParam&), dwSplitterPos& , 1)
~MoveWindow(Éditer2&, 0, dwSplitterPos&+4, LOWORD(lParam&),HIWORD(lParam&) - dwSplitterPos& -4, 1)
Endif
IF Msg& = ~WM_MOUSEMOVE
Déclarer rect#
DIM rect#,rect
IF HIWORD(lParam&) > 40
~SetCursor(hCursor&)
IF wParam& = ~MK_LBUTTON
~GetClientRect(Wnd&, rect#)
IF (HIWORD(lParam&) > rect#.bottom& -40)
RETOUR 0
ENDIF
dwSplitterPos& = HIWORD(lParam&)
~SendMessage(Wnd&,~WM_SIZE, 0, MAKELONG(rect#.right&, rect#.bottom&))
~UpdateWindow(Éditer1&)
~UpdateWindow(Éditer2&)
ENDIF
ENDIF
DISPOSE Rect#
ENDIF
IF Msg& = ~WM_LBUTTONDOWN
~SetCursor(hCursor&)
bSplitterMoving& = 1
~SetCapture(Wnd&)
Endif
IF Msg& = ~WM_LBUTTONUP
~Capture de sortie()
bSplitterMoving& = 0
Endif
IF Msg& = ~WM_CLOSE
~DeleteObject(hCursor&)
Messagebox("und Tschüss !","Ende",64)
~PostQuitMessage(0)
endif
RETOUR ~DefWindowProc(Wnd&, Msg&, wParam&, lParam&)
endproc
PROC Main
Déclarer Ende&,Éditer1&,Éditer2&,bSplitterMoving&,dwSplitterPos&,Window&
DIM WindowClass#,MyWindowClass
DIM Msg#,MyMsg
Classname$ = "XPrfWndClass"
Titre de la fenêtre$ = "H-Splitter"
WindowIcon$ = "A"
WITH WindowClass#
.style& = 0
.lpfnWndProc& = ProcAddr(WindowProc,4)
.cbClsExtra& = 0
.cbWndExtra& = 0
.hInstance& = %HInstance
.hIcon& = ~LoadIcon(%hInstance,Addr(WindowIcon$))
.hCursor& = ~LoadCursor(0, ~IDC_ARROW)
.hbrBackground& = ~CreateSolidBrush(~GetSysColor(~COLOR_BTNFACE))
.lpszMenuName& = Addr(Classname$)
.lpszClassName& = Addr(Classname$)
EndWith
IF ~RegisterClass(WindowClass#) = 0
MessageBox("Fehler beim Registrieren qui Anwendung !","Fehler...",16)
Fin
Endif
Window& = ~CreateWindowEx(\
0,\
Addr(Classname$),\
Addr(Titre de la fenêtre$),\
~ws_OverlappedWindow,\
~cw_UseDefault,\
~cw_UseDefault,\
640,\
480,\
0,\
0,\
%HInstance,\
0)
Éditer1& = ~CreateWindowEx(~WS_EX_CLIENTEDGE,"edit", 0,OU(OU(OU(OU(~WS_CHILD,~WS_VISIBLE),~WS_CLIPSIBLINGS),~ES_MULTILINE),~WS_VSCROLL),0, 0, width(window&), Height(window&)/2, window&, 1001,%hInstance,0)
Éditer2& = ~CreateWindowEx(~WS_EX_CLIENTEDGE,"edit", 0,OU(OU(OU(OU(~WS_CHILD,~WS_VISIBLE),~WS_CLIPSIBLINGS),~ES_MULTILINE),~WS_VSCROLL),0, Height(Éditer1&)+6, width(window&), Height(window&)/2, window&, 1002,%hInstance,0)
ClearList
AddFiles "C:\*.*"
MoveListToEdit(Éditer1&)
MoveListToEdit(Éditer2&)
hCursor& = ~LoadCursor(0,~IDC_SIZENS)
bSplitterMoving& = 0
dwSplitterPos& = (Height(window&)/2) + 4
~ShowWindow(Window&, ~SW_SHOWNORMAL)
~UpdateWindow(Window&)
WHILE ~GetMessage(Msg#, 0, 0, 0) > 0
~TranslateMessage(Msg#)
~DispatchMessage(Msg#)
Endwhile
ENDPROC
Main
|
| | | | | |
| | p.specht
| je voulais im obigen Programme qui veraltete Schreibweise Éditer1& = OU(~WS_CHILD,~WS_VISIBLE) avec anschließendem MoveListToEdit, quoi encore zulässig ist et bien funktioniert, solange on qui PROFALT.INC einbindet, ... ... sur XProfan-11-Schreibweise changement: (~WS_CHILD OU ~WS_VISIBLE) et nachfolgendes MoveListToHandle.
seul, ca führt zur Fehlermeldung "Funktion pas sur cet Fensterobjekt anwendbar!" - Pourquoi s'il te plaît? |
| | | XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 11.12.2018 ▲ |
| |
| | Matthias Arlt | Ersetze aussi cela OU selbst et schreib es besser so: ... (~WS_CHILD | ~WS_VISIBLE) ...
Salut Matthias |
| | | WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia | 11.12.2018 ▲ |
| |
| | p.specht
| AHHHHHHHHHHHHHHHHHHHHHHHH !!! DANKE ! quelquefois ist on comment vernagelt ...
|
| | | XProfan 11Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 11.12.2018 ▲ |
| |
|
Zum QuelltextOptions du sujet | 5.683 Views |
Themeninformationencet Thema hat 4 participant: |