Forum | | | | - Page 1 - |
| Julian Schmidt | Hi, I try straight Tabchanged with one in a tab-Control plazierten tab-Control abzufragen. still somehow misslingt it. Why the? CompileMarkSeparationDef SetActiveTab(2) SendMessage(&(1),$0130C,&(2),0)
cls
var hTab1& = Create("TabCtrl", %hwnd, "Tab1", -1, 2, width(%hwnd)+4, height(%hwnd))
var hTab2& = Create("TabCtrl", hTab1&, "Tab1", 15, 45, width(hTab1&)-32, height(hTab1&)-60)
whileloop 4
InsertTab(hTab1&, &loop+1, "Tab"+Str$(&loop+1))
InsertTab(hTab2&, &loop+1, "Tab"+Str$(&loop+1))
Endwhile
while 1
waitinput
if TabChanged(hTab1&)
SetActiveTab(hTab2&,GetActiveTab(hTab1&))
elseif TabChanged(hTab2&)
SetActiveTab(hTab1&,GetActiveTab(hTab2&))
EndIf
Endwhile
LG
Julian57 |
| | | | |
| | « this Posting watts as Solution marked. » | | - Page 2 - |
| Julian Schmidt | thanks all The To this Thread something beigetragen having. it functions perfect CompileMarkSeparationDef SetActiveTab(2) SendMessage(&(1),$0130C,&(2),0)
cls
Usermessages 16
var hTab1& = Create("TabCtrl", %hwnd, "Tab1", -1, 2, width(%hwnd)+4, height(%hwnd))
var hTab2& = Create("TabCtrl", hTab1&, "Tab1", 15, 45, width(hTab1&)-32, height(hTab1&)-60)
Subclass %hwnd,1
whileloop 4
InsertTab(hTab1&, &loop+1, "Tab"+Str$(&loop+1))
InsertTab(hTab2&, &loop+1, "Tab"+Str$(&loop+1))
Endwhile
while 1
waitinput
if TabChanged(hTab1&)
SetActiveTab(hTab2&,GetActiveTab(hTab1&))
elseif %umessage=16
Subclass %hwnd,0
end
EndIf
Endwhile
SubClassProc
If SubClassMessage(%hwnd, $004E)
If long(&sLParam,0) = hTab2&
If long(&sLParam,8) = 0-550 - 1
SetActiveTab(hTab1&,GetActiveTab(hTab2&))
EndIf
EndIf
Set("WinProc",1)
EndIf
ENDPROC
|
| | | | | |
| | | | | - Page 1 - |
| Detlef Jagolski | Hello! CompileMarkSeparation $P+
SetErrorLevel 0
$H WINDOWS.PH
$H MESSAGES.PH
$H STRUCTS.PH
$H SHELLAPI.PH
$H COMMCTRL.PH
$I TABCONTROL.INC
Struct NMHDR = ~NMHDR
Proc OnApplicationExit
DeleteObject TextFont1&
Dispose pnmh#
Dispose TBC1#
Dispose TBC2#
SubClass %hwnd,0
SubClass PageControl1_Sheet1&,0
EndProc
Proc OnApplicationInit
EndProc
OnApplicationInit
Declare appexit%
Declare pnmh#
Declare TBC1#
Declare TBC2#
Declare PageControl1_Sheet1&
Declare PageControl1_Sheet2&
Declare PageControl1_Sheet3&
Declare PageControl1_Sheet4&
Declare PageControl1_Sheet5&
Declare PageControl2_Sheet1&
Declare PageControl2_Sheet2&
Declare PageControl2_Sheet3&
Declare PageControl2_Sheet4&
Declare PageControl2_Sheet5&
Declare PageControl1&
Declare PageControl2&
Dim TBC1#,TabControl
Dim TBC2#,TabControl
Dim pnmh#,NMHDR
var TextFont1& = Create("Font","MS Sans Serif",13,0,0,0,0)
Proc PageControl1_OnChange
Declare TBC1&
TBC1& = TBC1#.GetActiveTab()
If TBC1& = 0
TBC1#.SetActiveSheet(PageControl1_Sheet1&,1)
TBC1#.SetActiveSheet(PageControl1_Sheet2&,0)
TBC1#.SetActiveSheet(PageControl1_Sheet3&,0)
TBC1#.SetActiveSheet(PageControl1_Sheet4&,0)
TBC1#.SetActiveSheet(PageControl1_Sheet5&,0)
ElseIf TBC1& = 1
TBC1#.SetActiveSheet(PageControl1_Sheet1&,0)
TBC1#.SetActiveSheet(PageControl1_Sheet2&,1)
TBC1#.SetActiveSheet(PageControl1_Sheet3&,0)
TBC1#.SetActiveSheet(PageControl1_Sheet4&,0)
TBC1#.SetActiveSheet(PageControl1_Sheet5&,0)
ElseIf TBC1& = 2
TBC1#.SetActiveSheet(PageControl1_Sheet1&,0)
TBC1#.SetActiveSheet(PageControl1_Sheet2&,0)
TBC1#.SetActiveSheet(PageControl1_Sheet3&,1)
TBC1#.SetActiveSheet(PageControl1_Sheet4&,0)
TBC1#.SetActiveSheet(PageControl1_Sheet5&,0)
ElseIf TBC1& = 3
TBC1#.SetActiveSheet(PageControl1_Sheet1&,0)
TBC1#.SetActiveSheet(PageControl1_Sheet2&,0)
TBC1#.SetActiveSheet(PageControl1_Sheet3&,0)
TBC1#.SetActiveSheet(PageControl1_Sheet4&,1)
TBC1#.SetActiveSheet(PageControl1_Sheet5&,0)
ElseIf TBC1& = 4
TBC1#.SetActiveSheet(PageControl1_Sheet1&,0)
TBC1#.SetActiveSheet(PageControl1_Sheet2&,0)
TBC1#.SetActiveSheet(PageControl1_Sheet3&,0)
TBC1#.SetActiveSheet(PageControl1_Sheet4&,0)
TBC1#.SetActiveSheet(PageControl1_Sheet5&,1)
EndIf
EndProc
Proc PageControl2_OnChange
Declare TBC2&
TBC2& = TBC2#.GetActiveTab()
If TBC2& = 0
TBC2#.SetActiveSheet(PageControl2_Sheet1&,1)
TBC2#.SetActiveSheet(PageControl2_Sheet2&,0)
TBC2#.SetActiveSheet(PageControl2_Sheet3&,0)
TBC2#.SetActiveSheet(PageControl2_Sheet4&,0)
TBC2#.SetActiveSheet(PageControl2_Sheet5&,0)
ElseIf TBC2& = 1
TBC2#.SetActiveSheet(PageControl2_Sheet1&,0)
TBC2#.SetActiveSheet(PageControl2_Sheet2&,1)
TBC2#.SetActiveSheet(PageControl2_Sheet3&,0)
TBC2#.SetActiveSheet(PageControl2_Sheet4&,0)
TBC2#.SetActiveSheet(PageControl2_Sheet5&,0)
ElseIf TBC2& = 2
TBC2#.SetActiveSheet(PageControl2_Sheet1&,0)
TBC2#.SetActiveSheet(PageControl2_Sheet2&,0)
TBC2#.SetActiveSheet(PageControl2_Sheet3&,1)
TBC2#.SetActiveSheet(PageControl2_Sheet4&,0)
TBC2#.SetActiveSheet(PageControl2_Sheet5&,0)
ElseIf TBC2& = 3
TBC2#.SetActiveSheet(PageControl2_Sheet1&,0)
TBC2#.SetActiveSheet(PageControl2_Sheet2&,0)
TBC2#.SetActiveSheet(PageControl2_Sheet3&,0)
TBC2#.SetActiveSheet(PageControl2_Sheet4&,1)
TBC2#.SetActiveSheet(PageControl2_Sheet5&,0)
ElseIf TBC2& = 4
TBC2#.SetActiveSheet(PageControl2_Sheet1&,0)
TBC2#.SetActiveSheet(PageControl2_Sheet2&,0)
TBC2#.SetActiveSheet(PageControl2_Sheet3&,0)
TBC2#.SetActiveSheet(PageControl2_Sheet4&,0)
TBC2#.SetActiveSheet(PageControl2_Sheet5&,1)
EndIf
EndProc
SubClassProc
If SubClassMessage(%hwnd, ~WM_NOTIFY)
pnmh# = &sLParam
If pnmh#.hwndFrom& = PageControl1&
If pnmh#.code& = ~TCN_SELCHANGE
PageControl1_OnChange
EndIf
EndIf
Set("WinProc",1)
ElseIf SubClassMessage(PageControl1&, ~WM_NOTIFY)
pnmh# = &sLParam
If pnmh#.hwndFrom& = PageControl2&
If pnmh#.code& = ~TCN_SELCHANGE
PageControl2_OnChange
EndIf
EndIf
Set("WinProc",1)
EndIf
EndProc
Set("TrueColor",1)
WindowStyle $003F
WindowTitle "DesignForm"
Window %maxX + 5,114 - 691,416
Cls ~GetSysColor(15)
UseFont "MS Sans Serif",13,0,0,0,0
SetDialogFont 1
var hToolBmp& = create("hPic", 0, "TOOLBAR")
var hImageList1& = Create("ImageList", 16, 16, hToolBmp&, rgb(192, 192, 192))
PageControl1& = TBC1#.TabControl(%hwnd,10,60,672,322,hImageList1&,"PageControl1","PageControl1")
PageControl1& = TBC1#.GetHandel()
TBC1#.TBFont(TextFont1&)
PageControl1_Sheet1& = TBC1#.CreateTabSheet(4,25,664,293,2000,1)
TBC1#.InsertTab(1,"Seite 1",9)
PageControl1_Sheet2& = TBC1#.CreateTabSheet(4,25,664,293,2001,0)
TBC1#.InsertTab(2,"Seite 2",9)
PageControl1_Sheet3& = TBC1#.CreateTabSheet(4,25,664,293,2002,0)
TBC1#.InsertTab(3,"Seite 3",9)
PageControl1_Sheet4& = TBC1#.CreateTabSheet(4,25,664,293,2003,0)
TBC1#.InsertTab(4,"Seite 4",9)
PageControl1_Sheet5& = TBC1#.CreateTabSheet(4,25,664,293,2004,0)
TBC1#.InsertTab(5,"Seite 5",9)
PageControl2& = TBC2#.TabControl(PageControl1_Sheet1&,30,20,442,193,hImageList1&,"PageControl2","PageControl2")
PageControl2& = TBC2#.GetHandel()
TBC2#.TBFont(TextFont1&)
PageControl2_Sheet1& = TBC2#.CreateTabSheet(4,25,434,164,2005,1)
TBC2#.InsertTab(1,"Seite 1",9)
PageControl2_Sheet2& = TBC2#.CreateTabSheet(4,25,434,164,2006,0)
TBC2#.InsertTab(2,"Seite 2",9)
PageControl2_Sheet3& = TBC2#.CreateTabSheet(4,25,434,164,2007,0)
TBC2#.InsertTab(3,"Seite 3",9)
PageControl2_Sheet4& = TBC2#.CreateTabSheet(4,25,434,164,2008,0)
TBC2#.InsertTab(4,"Seite 4",9)
PageControl2_Sheet5& = TBC2#.CreateTabSheet(4,25,434,164,2009,0)
TBC2#.InsertTab(5,"Seite 5",9)
SubClass %hwnd,1
SubClass PageControl1_Sheet1&,1
SetWindowPos %hwnd = 207,114 - 691,416;0
WhileNot appexit%
WaitInput
If %key = 2
appexit%=1
ElseIf %key = 4
' Fenstergröße
ElseIf %key = 5
' Hilfe
href='./../../Function-References/XProfan/endif/'>EndIf
EndWhile
OnApplicationExit
Greeting
Detlef |
| | | | |
| | Julian Schmidt | the functions of course, though I get not on my example transfer. CompileMarkSeparation $H MESSAGES.PH
$H STRUCTS.PH
$H SHELLAPI.PH
$H COMMCTRL.PH
Struct NMHDR = ~NMHDR
Def SetActiveTab(2) SendMessage(&(1),$0130C,&(2),0)
cls
Usermessages 16
var hTab1& = Create("TabCtrl", %hwnd, "Tab1", -1, 2, width(%hwnd)+4, height(%hwnd))
var hTab2& = Create("TabCtrl", hTab1&, "Tab1", 15, 45, width(hTab1&)-32, height(hTab1&)-60)
Subclass hTab2&,1
Declare pnmh#
Dim pnmh#,NMHDR
whileloop 4
InsertTab(hTab1&, &loop+1, "Tab"+Str$(&loop+1))
InsertTab(hTab2&, &loop+1, "Tab"+Str$(&loop+1))
Endwhile
while 1
waitinput
if TabChanged(hTab1&)
SetActiveTab(hTab2&,GetActiveTab(hTab1&))
elseif %umessage=16
Subclass hTab2&,0
end
EndIf
Endwhile
SubClassProc
If SubClassMessage(hTab2&, ~WM_NOTIFY)
pnmh# = &sLParam
If pnmh#.hwndFrom& = PageControl1&
If pnmh#.code& = ~TCN_SELCHANGE
SetActiveTab(hTab1&,GetActiveTab(hTab2&))
EndIf
EndIf
Set("WinProc",1)
EndIf
../Function-References/XProfan/endproc/'>ENDPROC
|
| | | | |
| | Detlef Jagolski | CompileMarkSeparation $H WINDOWS.PH
$H MESSAGES.PH
$H STRUCTS.PH
$H SHELLAPI.PH
$H COMMCTRL.PH
Struct NMHDR = ~NMHDR
Def SetActiveTab(2) SendMessage(&(1),$0130C,&(2),0)
cls
Usermessages 16
var hTab1& = Create("TabCtrl", %hwnd, "Tab1", -1, 2, width(%hwnd)+4, height(%hwnd))
var hTab2& = Create("TabCtrl", hTab1&, "Tab1", 15, 45, width(hTab1&)-32, height(hTab1&)-60)
Subclass %hwnd,1
Declare Tab%
Declare pnmh#
Dim pnmh#,NMHDR
whileloop 4
InsertTab(hTab1&, &loop+1, "Tab"+Str$(&loop+1))
InsertTab(hTab2&, &loop+1, "Tab"+Str$(&loop+1))
Endwhile
while 1
waitinput
if TabChanged(hTab1&)
SetActiveTab(hTab2&,GetActiveTab(hTab1&))
elseif %umessage=16
Subclass hTab2&,0
end
EndIf
Endwhile
SubClassProc
If SubClassMessage(%hwnd, ~WM_NOTIFY)
pnmh# = &sLParam
If pnmh#.hwndFrom& = hTab1&
If pnmh#.code& = ~TCN_SELCHANGE
Tab% = GetActiveTab(hTab1&)
If Tab% = 0
SetWindowPos hTab2&=15, 45-width(hTab1&)-32, height(hTab1&)-60;0
ElseIf Tab% = 1
SetWindowPos hTab2&=0, 0-0,0;0
ElseIf Tab% = 2
SetWindowPos hTab2&=0, 0-0,0;0
ElseIf Tab% = 3
SetWindowPos hTab2&=0, 0-0,0;0
ElseIf Tab% = 4
SetWindowPos hTab2&=0, 0-0,0;0
EndIf
EndIf
EndIf
Set("WinProc",1)
EndI
ENDPROC
|
| | | XProfan X4, PRFellow, Profan2Cpp - Version 2.0c-pre5, Windows 11 | 01/06/12 ▲ |
| |
| | Julian Schmidt | OK the functions super. CompileMarkSeparationStruct NMHDR = hwndFrom&,idFrom&,code&
Def SetActiveTab(2) SendMessage(&(1),$0130C,&(2),0)
cls
Usermessages 16
var hTab1& = Create("TabCtrl", %hwnd, "Tab1", -1, 2, width(%hwnd)+4, height(%hwnd))
var hTab2& = Create("TabCtrl", hTab1&, "Tab1", 15, 45, width(hTab1&)-32, height(hTab1&)-60)
Subclass %hwnd,1
Declare pnmh#
Dim pnmh#,NMHDR
whileloop 4
InsertTab(hTab1&, &loop+1, "Tab"+Str$(&loop+1))
InsertTab(hTab2&, &loop+1, "Tab"+Str$(&loop+1))
Endwhile
while 1
waitinput
if TabChanged(hTab1&)
SetActiveTab(hTab2&,GetActiveTab(hTab1&))
elseif %umessage=16
Subclass hTab2&,0
end
EndIf
Endwhile
SubClassProc
If SubClassMessage(%hwnd, $004E)
pnmh# = &sLParam
If pnmh#.hwndFrom& = hTab2&
If pnmh#.code& = 0-550 - 1
SetActiveTab(hTab1&,GetActiveTab(hTab2&))
EndIf
EndIf
Set("WinProc",1)
EndIf
ENDPROC
would be the theoretical too without The class possible? |
| | | | |
| | | this is no class separate a structure or. one plainer memory.
this hwndFrom&,idFrom&,code& are 3 Longs means 3x4 byte means can You too Dim pnmh#,12 write without NMHDR To deklarieren and pnmh#.code& would then long(pnmh#,8) but instead of pnmh# = &sLParam would I sooner rtlMoveMemory(pnmh#,&slParam,12) write. |
| | | | |
| | Detlef Jagolski | CompileMarkSeparationDef SetActiveTab(2) SendMessage(&(1),$0130C,&(2),0)
cls
Usermessages 16
var hTab1& = Create("TabCtrl", %hwnd, "Tab1", -1, 2, width(%hwnd)+4, height(%hwnd))
var hTab2& = Create("TabCtrl", hTab1&, "Tab1", 15, 45, width(hTab1&)-32, height(hTab1&)-60)
Declare Tab%
whileloop 4
InsertTab(hTab1&, &loop+1, "Tab"+Str$(&loop+1))
InsertTab(hTab2&, &loop+1, "Tab"+Str$(&loop+1))
Endwhile
while 1
waitinput
if TabChanged(hTab1&)
PageControl1_OnChange
elseif %umessage=16
Subclass hTab2&,0
end
EndIf
Endwhile
Proc PageControl1_OnChange
Tab% = GetActiveTab(hTab1&)
If Tab% = 0
SetWindowPos hTab2&=15, 45-width(hTab1&)-32, height(hTab1&)-60;0
ElseIf Tab% = 1
SetWindowPos hTab2&=0, 0-0,0;0
ElseIf Tab% = 2
SetWindowPos hTab2&=0, 0-0,0;0
ElseIf Tab% = 3
SetWindowPos hTab2&=0, 0-0,0;0
ElseIf Tab% = 4
SetWindowPos hTab2&=0, 0-0,0;0
EndIf
ENDPROC
|
| | | | |
| | | | - Page 2 - |
| | Julian Schmidt | iF (06.01.12)
this is no class separate a structure or. one plainer memory. this hwndFrom&,idFrom&,code& are 3 Longs means 3x4 byte means can You too Dim pnmh#,12 write without NMHDR To deklarieren and pnmh#.code& would then long(pnmh#,8) but instead of pnmh# = &sLParam would I sooner rtlMoveMemory(pnmh#,&slParam,12) write.
is correct so funktionierts. thanks IF CompileMarkSeparationDef SetActiveTab(2) SendMessage(&(1),$0130C,&(2),0)
cls
Usermessages 16
var hTab1& = Create("TabCtrl", %hwnd, "Tab1", -1, 2, width(%hwnd)+4, height(%hwnd))
var hTab2& = Create("TabCtrl", hTab1&, "Tab1", 15, 45, width(hTab1&)-32, height(hTab1&)-60)
Subclass %hwnd,1
Declare pnmh#
Dim pnmh#,12
whileloop 4
InsertTab(hTab1&, &loop+1, "Tab"+Str$(&loop+1))
InsertTab(hTab2&, &loop+1, "Tab"+Str$(&loop+1))
Endwhile
while 1
waitinput
if TabChanged(hTab1&)
SetActiveTab(hTab2&,GetActiveTab(hTab1&))
elseif %umessage=16
Subclass hTab2&,0
Dispose pnmh#
end
EndIf
Endwhile
SubClassProc
If SubClassMessage(%hwnd, $004E)
pnmh# = &sLParam
If long(pnmh#,0) = hTab2&
If long(pnmh#,8) = 0-550 - 1
SetActiveTab(hTab1&,GetActiveTab(hTab2&))
EndIf
EndIf
Set("WinProc",1)
EndIf
ENDPROC
|
| | | | |
| | | so far so well, but!
You write pnmh# = &sLParam -
müsstest but rtlMoveMemory(pnmh#,&sLParam,12) write because otherwise Abstürze etc... |
| | | | |
| | Julian Schmidt | Gibts The function in anybody Include-File? XProfan bleats function uncharted |
| | | | |
| | | If you XPSE einsetzt is these API simply so To write,
otherwise simply external("RtlMoveMemory","kernel32",... |
| | | | |
| | | Nachtrag: If I it again überdenke will need you still pnmh# not at all,
simply directly from long(&slParam,... reading because then can You you too the copy save. |
| | | | |
| | Julian Schmidt | thanks all The To this Thread something beigetragen having. it functions perfect CompileMarkSeparationDef SetActiveTab(2) SendMessage(&(1),$0130C,&(2),0)
cls
Usermessages 16
var hTab1& = Create("TabCtrl", %hwnd, "Tab1", -1, 2, width(%hwnd)+4, height(%hwnd))
var hTab2& = Create("TabCtrl", hTab1&, "Tab1", 15, 45, width(hTab1&)-32, height(hTab1&)-60)
Subclass %hwnd,1
whileloop 4
InsertTab(hTab1&, &loop+1, "Tab"+Str$(&loop+1))
InsertTab(hTab2&, &loop+1, "Tab"+Str$(&loop+1))
Endwhile
while 1
waitinput
if TabChanged(hTab1&)
SetActiveTab(hTab2&,GetActiveTab(hTab1&))
elseif %umessage=16
Subclass %hwnd,0
end
EndIf
Endwhile
SubClassProc
If SubClassMessage(%hwnd, $004E)
If long(&sLParam,0) = hTab2&
If long(&sLParam,8) = 0-550 - 1
SetActiveTab(hTab1&,GetActiveTab(hTab2&))
EndIf
EndIf
Set("WinProc",1)
EndIf
ENDPROC
|
| | | | |
|
AnswerTopic-Options | 13.669 Views |
Themeninformationenthis Topic has 3 subscriber: |