English
Source / code snippets

Horizontaler Splitter XProfan

 
- Page 1 -


Horizontaler Splitter with XProfan of Andreas Miethe:
CompileMarkSeparation
#############################
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
salvo, iF
 
07/01/05  
 



« this Posting watts as Solution marked. »


Jörg
Sellmeyer
and repariert...
 $I profalt.inc
'#############################
'XProfan
'#############################
'Author : Andreas Miethe
'2003
'#############################
'Topic : Horizontal-Splitter
'#############################
'SetTrueColor 1
set("FastMode",1)
'------------------------
'Header-Files integrate
'------------------------
 $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)
'------------------------
'------------------------
'Structures
'------------------------
STRUCT MyWindowClass = ~WndClass
STRUCT MyMsg = ~Msg
STRUCT rect = ~RECT
'------------------------
Declare hCursor&,Classname$,Window Title$,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

        ~Capture Release()
        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"
    Window Title$ = "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("Error at Register the application !","Error...",16)
        End

    Endif

    Window& = ~CreateWindowEx(\
    0,\
    Addr(Classname$),\
    Addr(Window Title$),\
    ~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
 
XProfan X4
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
06/18/18  
 




p.specht

I wanted to in the obigen Program The antiquated spelling
Edit1& = OR(~WS_CHILD,~WS_VISIBLE) with anschließendem
MoveListToEdit, what yet permitted is and well functions, as long as one The PROFALT.INC einbindet, ...
... on XProfan-11-spelling Change:
(~WS_CHILD OR ~WS_VISIBLE) and nachfolgendes MoveListToHandle.

alone, this lead to Error Message "Function not this Fensterobjekt applicable!" - Why Please?
 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
12/11/18  
 




Matthias
Arlt
supplant too the OR self and schreib it rather so:
... (~WS_CHILD | ~WS_VISIBLE) ...

Greeting Matthias
 
WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia
12/11/18  
 




p.specht

AHHHHHHHHHHHHHHHHHHHHHHHH !!!
THANK YOU ! sometimes is one How vernagelt ...
 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
12/11/18  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

5.702 Views

Untitledvor 0 min.
Rolf Koch09/21/21
Sven Bader09/10/21
p.specht05/29/21
iF09/14/20
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie