English
Source / code snippets

better TabControl Use

 
- Page 1 -



ByteAttack
in the HTML-Using XProfan go with one Tabwechsel each single element with one Tabwechsel ausgeblendet. It's all right but too plenty eleganter a dialog.
example:
CompileMarkSeparation
 $P*
USERMESSAGES 16
Declare ende%,Tab&,TabLinks%,TabRechts%,TabOben%,TabUnten%
Declare Tab1Dialog&,Tab2Dialog&,Tab3Dialog&
Declare Wechsel0&,Wechsel1&,Wechsel2&
Def GetSysColor(1) !USER32,GetSysColor
Def Setactivetab(2) Sendmessage(&(1),$0130C,&(2),0)

Proc Tabgross   by iF (www.xprofan.com)

    Parameters Reiter%
    STRUCT RECT=LEFT&,TOP&,RIGHT&,BOTTOM&
    DECLARE MEINREC#
    DIM MEINREC#,RECT
    SENDMESSAGE(TAB&,$1300+10,Reiter%,ADDR(MEINREC#))
    TabLinks%=MEINREC#.LEFT&
    TabRechts%=MEINREC#.RIGHT&
    TabOben%=MEINREC#.TOP&
    TabUnten%=MEINREC#.BOTTOM&
    DISPOSE MEINREC#

EndProc

Proc Elemente  Irgendwelche Element zum Testen

    Create(Edit,Tab1Dialog&,Eingabe 1,10,10,100,24)
    Create(Edit,Tab1Dialog&,Eingabe 2,10,40,100,24)
    Create(Edit,Tab1Dialog&,Eingabe 3,10,70,100,24)
    Create(Button,Tab1Dialog&,Button 1,120,10,100,24)
    Create(Button,Tab1Dialog&,Button 2,120,40,100,24)
    Create(Button,Tab1Dialog&,Button 3,120,70,100,24)
    Create(Edit,Tab2Dialog&,Eingabe 4,100,10,100,24)
    Create(Edit,Tab2Dialog&,Eingabe 5,100,40,100,24)
    Create(Edit,Tab2Dialog&,Eingabe 6,100,70,100,24)
    Create(Button,Tab2Dialog&,Button 4,210,10,100,24)
    Create(Button,Tab2Dialog&,Button 5,210,40,100,24)
    Create(Button,Tab2Dialog&,Button 6,210,70,100,24)
    Create(Edit,Tab3Dialog&,Eingabe 7,200,10,100,24)
    Create(Edit,Tab3Dialog&,Eingabe 8,200,40,100,24)
    Create(Edit,Tab3Dialog&,Eingabe 9,200,70,100,24)
    Create(Button,Tab3Dialog&,Button 7,310,10,100,24)
    Create(Button,Tab3Dialog&,Button 8,310,40,100,24)
    Create(Button,Tab3Dialog&,Button 9,310,70,100,24)

EndProc

Proc MakeTab  Erstellt Tabs & Controls

    Tab&=Create(TabCtrl,%hwnd,Reiter 1,5,5,700,500)
    InsertTab(Tab&,1,Reiter 2)
    InsertTab(Tab&,2,Reiter 3)
    Tabgross 0
    Tab1Dialog&=Control(DIALOG,,$54000000,TabLinks%,TabOben%+TabUnten%,width(Tab&)-(TabLinks%*3),height(Tab&)-(TabUnten%+(TabOben%*3)),Tab&,2000,%hinstance)
    Tab2Dialog&=Control(DIALOG,,$54000000,TabLinks%,TabOben%+TabUnten%,width(Tab&)-(TabLinks%*3),height(Tab&)-(TabUnten%+(TabOben%*3)),Tab&,2000,%hinstance)
    Tab3Dialog&=Control(DIALOG,,$54000000,TabLinks%,TabOben%+TabUnten%,width(Tab&)-(TabLinks%*3),height(Tab&)-(TabUnten%+(TabOben%*3)),Tab&,2000,%hinstance)
    ShowWindow(Tab2Dialog&,0)
    ShowWindow(Tab3Dialog&,0)
    Elemente

EndProc

Proc TabWechsel

    ShowWindow(Tab1Dialog&,GetActiveTab(Tab&)=0)
    ShowWindow(Tab2Dialog&,GetActiveTab(Tab&)=1)
    ShowWindow(Tab3Dialog&,GetActiveTab(Tab&)=2)

EndProc

SetTrueColor 1
WindowStyle 24
WindowTitle Tab´s
Window ((%maxX/2)-400),((%maxY/2)-300)-800,600
UseFont Verdana,16,0,1,0,0
SetDialogFont 1
CLS GetSysColor(15)
MakeTab
Wechsel0&=Create(Button,%hwnd,Reiter 1,10,530,100,24)
Wechsel1&=Create(Button,%hwnd,Reiter 2,120,530,100,24)
Wechsel2&=Create(Button,%hwnd,Reiter 3,230,530,100,24)

WhileNot ende%

    WaitInput

    If %Umessage=16  X

        ende%=1

    ElseIf TabChanged(Tab&)  TabClicked

        Tabwechsel

    ElseIf Clicked(Wechsel0&)  Programmierbarer Wechsel

        Setactivetab(Tab&,0)
        Tabwechsel

    ElseIf Clicked(Wechsel1&)

        Setactivetab(Tab&,1)
        Tabwechsel

    ElseIf Clicked(Wechsel2&)

        Setactivetab(Tab&,2)
        Tabwechsel

    EndIf

Wend

 
Website:  [...] 
Facebook:  [...] 
11/21/07  
 



« this Posting watts as Solution marked. »


Jörg
Sellmeyer

 $P*
USERMESSAGES 16
Declare end%,Tab&,TabLinks%,TabRechts%,TabOben%,TabUnten%
Declare tab1Dialog&,tab2Dialog&,tab3Dialog&
Declare change0&,change1&,change2&
Def GetSysColor(1) !"USER32","GetSysColor"
Def Setactivetab(2) Sendmessage(&(1),$0130C,&(2),0)

Proc Tabgross'by iF (www.XProfan.com)

    Parameters tab%
    STRUCT RECT=LEFT&,TOP&,RIGHT&,BOTTOM&
    DECLARE MEINREC#
    DIM MEINREC#,RECT
    SENDMESSAGE(TAB&,$1300+10,tab%,ADDR(MEINREC#))
    TabLinks%=MEINREC#.LEFT&
    TabRechts%=MEINREC#.RIGHT&
    TabOben%=MEINREC#.TOP&
    TabUnten%=MEINREC#.BOTTOM&
    DISPOSE MEINREC#

ENDPROC

Proc items' any element to that testing

    Create("Edit",tab1Dialog&,"Eingabe 1",10,10,100,24)
    Create("Edit",tab1Dialog&,"Eingabe 2",10,40,100,24)
    Create("Edit",tab1Dialog&,"Eingabe 3",10,70,100,24)
    Create("Button",tab1Dialog&,"Button 1",120,10,100,24)
    Create("Button",tab1Dialog&,"Button 2",120,40,100,24)
    Create("Button",tab1Dialog&,"Button 3",120,70,100,24)
    Create("Edit",tab2Dialog&,"Eingabe 4",100,10,100,24)
    Create("Edit",tab2Dialog&,"Eingabe 5",100,40,100,24)
    Create("Edit",tab2Dialog&,"Eingabe 6",100,70,100,24)
    Create("Button",tab2Dialog&,"Button 4",210,10,100,24)
    Create("Button",tab2Dialog&,"Button 5",210,40,100,24)
    Create("Button",tab2Dialog&,"Button 6",210,70,100,24)
    Create("Edit",tab3Dialog&,"Eingabe 7",200,10,100,24)
    Create("Edit",tab3Dialog&,"Eingabe 8",200,40,100,24)
    Create("Edit",tab3Dialog&,"Eingabe 9",200,70,100,24)
    Create("Button",tab3Dialog&,"Button 7",310,10,100,24)
    Create("Button",tab3Dialog&,"Button 8",310,40,100,24)
    Create("Button",tab3Dialog&,"Button 9",310,70,100,24)

ENDPROC

Proc MakeTab' prepares Tabs & Controls

    Tab&=Create("TabCtrl",%hwnd,"Reiter 1",5,5,700,500)
    InsertTab(Tab&,1,"Reiter 2")
    InsertTab(Tab&,2,"Reiter 3")
    Tabgross 0
    tab1Dialog&=Control("DIALOG","",$54000000,TabLinks%,TabOben%+TabUnten%,width(Tab&)-(TabLinks%*3),height(Tab&)-(TabUnten%+(TabOben%*3)),Tab&,2000,%hinstance)
    tab2Dialog&=Control("DIALOG","",$54000000,TabLinks%,TabOben%+TabUnten%,width(Tab&)-(TabLinks%*3),height(Tab&)-(TabUnten%+(TabOben%*3)),Tab&,2000,%hinstance)
    tab3Dialog&=Control("DIALOG","",$54000000,TabLinks%,TabOben%+TabUnten%,width(Tab&)-(TabLinks%*3),height(Tab&)-(TabUnten%+(TabOben%*3)),Tab&,2000,%hinstance)
    ShowWindow(tab2Dialog&,0)
    ShowWindow(tab3Dialog&,0)
    items

ENDPROC

Proc TabWechsel

    ShowWindow(tab1Dialog&,GetActiveTab(Tab&)=0)
    ShowWindow(tab2Dialog&,GetActiveTab(Tab&)=1)
    ShowWindow(tab3Dialog&,GetActiveTab(Tab&)=2)

ENDPROC

SetTrueColor 1
Window Style 24
Window Title "Tabs"
Window ((%maxX/2)-400),((%maxY/2)-300)-800,600
UseFont "Verdana",16,0,1,0,0
SetDialogFont 1
CLS GetSysColor(15)
MakeTab
Wechsel0&=Create("Button",%hwnd,"Reiter 1",10,530,100,24)
Wechsel1&=Create("Button",%hwnd,"Reiter 2",120,530,100,24)
Wechsel2&=Create("Button",%hwnd,"Reiter 3",230,530,100,24)

WhileNot end%

    WaitInput

    If %Umessage=16'X

        end%=1

    ElseIf TabChanged(Tab&)'TabClicked

        Tabwechsel

    ElseIf Clicked(change0&)'Programmierbarer change

        Setactivetab(Tab&,0)
        Tabwechsel

    ElseIf Clicked(change1&)

        Setactivetab(Tab&,1)
        Tabwechsel

    ElseIf Clicked(change2&)

        Setactivetab(Tab&,2)
        Tabwechsel

    EndIf

Wend

 
XProfan X4
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
06/23/18  
 




Jörg
Sellmeyer
You can you another couple Lines save:
CompileMarkSeparation
Proc TabWechsel

    ShowWindow(Tab1Dialog&,GetActiveTab(Tab&)=0)
    ShowWindow(Tab2Dialog&,GetActiveTab(Tab&)=1)
    ShowWindow(Tab3Dialog&,GetActiveTab(Tab&)=2)

EndP
>

then need the in the Ifstruktur none More to emerge.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
11/21/07  
 




Jörg
Sellmeyer

 $P*
USERMESSAGES 16
Declare end%,Tab&,TabLinks%,TabRechts%,TabOben%,TabUnten%
Declare tab1Dialog&,tab2Dialog&,tab3Dialog&
Declare change0&,change1&,change2&
Def GetSysColor(1) !"USER32","GetSysColor"
Def Setactivetab(2) Sendmessage(&(1),$0130C,&(2),0)

Proc Tabgross'by iF (www.XProfan.com)

    Parameters tab%
    STRUCT RECT=LEFT&,TOP&,RIGHT&,BOTTOM&
    DECLARE MEINREC#
    DIM MEINREC#,RECT
    SENDMESSAGE(TAB&,$1300+10,tab%,ADDR(MEINREC#))
    TabLinks%=MEINREC#.LEFT&
    TabRechts%=MEINREC#.RIGHT&
    TabOben%=MEINREC#.TOP&
    TabUnten%=MEINREC#.BOTTOM&
    DISPOSE MEINREC#

ENDPROC

Proc items' any element to that testing

    Create("Edit",tab1Dialog&,"Eingabe 1",10,10,100,24)
    Create("Edit",tab1Dialog&,"Eingabe 2",10,40,100,24)
    Create("Edit",tab1Dialog&,"Eingabe 3",10,70,100,24)
    Create("Button",tab1Dialog&,"Button 1",120,10,100,24)
    Create("Button",tab1Dialog&,"Button 2",120,40,100,24)
    Create("Button",tab1Dialog&,"Button 3",120,70,100,24)
    Create("Edit",tab2Dialog&,"Eingabe 4",100,10,100,24)
    Create("Edit",tab2Dialog&,"Eingabe 5",100,40,100,24)
    Create("Edit",tab2Dialog&,"Eingabe 6",100,70,100,24)
    Create("Button",tab2Dialog&,"Button 4",210,10,100,24)
    Create("Button",tab2Dialog&,"Button 5",210,40,100,24)
    Create("Button",tab2Dialog&,"Button 6",210,70,100,24)
    Create("Edit",tab3Dialog&,"Eingabe 7",200,10,100,24)
    Create("Edit",tab3Dialog&,"Eingabe 8",200,40,100,24)
    Create("Edit",tab3Dialog&,"Eingabe 9",200,70,100,24)
    Create("Button",tab3Dialog&,"Button 7",310,10,100,24)
    Create("Button",tab3Dialog&,"Button 8",310,40,100,24)
    Create("Button",tab3Dialog&,"Button 9",310,70,100,24)

ENDPROC

Proc MakeTab' prepares Tabs & Controls

    Tab&=Create("TabCtrl",%hwnd,"Reiter 1",5,5,700,500)
    InsertTab(Tab&,1,"Reiter 2")
    InsertTab(Tab&,2,"Reiter 3")
    Tabgross 0
    tab1Dialog&=Control("DIALOG","",$54000000,TabLinks%,TabOben%+TabUnten%,width(Tab&)-(TabLinks%*3),height(Tab&)-(TabUnten%+(TabOben%*3)),Tab&,2000,%hinstance)
    tab2Dialog&=Control("DIALOG","",$54000000,TabLinks%,TabOben%+TabUnten%,width(Tab&)-(TabLinks%*3),height(Tab&)-(TabUnten%+(TabOben%*3)),Tab&,2000,%hinstance)
    tab3Dialog&=Control("DIALOG","",$54000000,TabLinks%,TabOben%+TabUnten%,width(Tab&)-(TabLinks%*3),height(Tab&)-(TabUnten%+(TabOben%*3)),Tab&,2000,%hinstance)
    ShowWindow(tab2Dialog&,0)
    ShowWindow(tab3Dialog&,0)
    items

ENDPROC

Proc TabWechsel

    ShowWindow(tab1Dialog&,GetActiveTab(Tab&)=0)
    ShowWindow(tab2Dialog&,GetActiveTab(Tab&)=1)
    ShowWindow(tab3Dialog&,GetActiveTab(Tab&)=2)

ENDPROC

SetTrueColor 1
Window Style 24
Window Title "Tabs"
Window ((%maxX/2)-400),((%maxY/2)-300)-800,600
UseFont "Verdana",16,0,1,0,0
SetDialogFont 1
CLS GetSysColor(15)
MakeTab
Wechsel0&=Create("Button",%hwnd,"Reiter 1",10,530,100,24)
Wechsel1&=Create("Button",%hwnd,"Reiter 2",120,530,100,24)
Wechsel2&=Create("Button",%hwnd,"Reiter 3",230,530,100,24)

WhileNot end%

    WaitInput

    If %Umessage=16'X

        end%=1

    ElseIf TabChanged(Tab&)'TabClicked

        Tabwechsel

    ElseIf Clicked(change0&)'Programmierbarer change

        Setactivetab(Tab&,0)
        Tabwechsel

    ElseIf Clicked(change1&)

        Setactivetab(Tab&,1)
        Tabwechsel

    ElseIf Clicked(change2&)

        Setactivetab(Tab&,2)
        Tabwechsel

    EndIf

Wend

 
XProfan X4
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
06/23/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

7.351 Views

Untitledvor 0 min.
Axel Berse11/08/23
Sven Bader03/14/23
Normann Strübli02/04/23
RudiB.10/02/22
More...

Themeninformationen

this Topic has 2 subscriber:

Jörg Sellmeyer (2x)
ByteAttack (1x)


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