Fonte/ Codesnippets | | | | - Page 1 - |
| ByteAttack | In der HTML-Aiuto von XProfan werden bei einem Tabwechsel jedes einzelne Element bei einem Tabwechsel ausgeblendet. Es geht aber auch viel eleganter circa einen Dialog. Beispiel: KompilierenMarkierenSeparieren $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
|
| | | | |
| | « Dieser Beitrag wurde als Lösung gekennzeichnet. » | | Jörg Sellmeyer |
$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 "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 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
|
| | | | | |
| | Jörg Sellmeyer | | | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 21.11.2007 ▲ |
| |
| | Jörg Sellmeyer |
$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 "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 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
|
| | | | |
|
Zum QuelltextThemeninformationenDieses Thema hat 2 subscriber: |