
Thanks you for help.
Code: Select all
Procedure IsMouseOver(hWnd)
GetWindowRect_(hWnd,r.RECT)
GetCursorPos_(p.POINT)
Result = PtInRect_(r,p\y << 32 + p\x)
ProcedureReturn Result
EndProcedure
Procedure _MyPanelGadget(hWnd, id, x, y, x1, y1)
tc = CreateWindowEx_(0, "SysTabControl32", "",#WS_OVERLAPPED | #WS_CHILD | #WS_VISIBLE | #WS_CLIPSIBLINGS | #WS_GROUP | #WS_TABSTOP | #TCS_VERTICAL, x, y, x1, y1, hwnd, id, 0, 0)
ProcedureReturn tc
EndProcedure
Procedure AddTab(wnd.i, index.i, text.s)
tad.TC_ITEM
tad\mask = 1
tad\pszText = @text.s
tad\cchTextMax = Len(text)
tad\iImage = -1
tad\lParam = 0
SendMessage_(wnd, #TCM_INSERTITEM, index, tad)
EndProcedure
Procedure DeleteTabControl(wnd.i)
DestroyWindow_(wnd)
EndProcedure
If OpenWindow(0, 0, 0, 600, 460, "Vertical Panel Gadget", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
SetWindowColor(0,$C6FEFD)
tc = _MyPanelGadget(WindowID(0), 100 , 20, 50, 260,390)
AddTab(tc, 0, "General")
Dim tab(3)
cont0 = ContainerGadget(#PB_Any,45,54,232,384)
tab(0) = cont0
SetGadgetColor(cont0,#PB_Gadget_BackColor,$E6E6E6)
ButtonGadget(10,10,10,100,30,"test")
CloseGadgetList()
AddTab(tc, 1, "Video")
cont1 = ContainerGadget(#PB_Any,45,54,232,384)
tab(1) = cont1
SetGadgetColor(cont1,#PB_Gadget_BackColor,$CDF4FE)
ButtonGadget(20,10,10,100,30,"test #1")
CloseGadgetList()
AddTab(tc, 2, "Audio")
cont2 = ContainerGadget(#PB_Any,45,54,232,384)
tab(2) = cont2
SetGadgetColor(cont2,#PB_Gadget_BackColor,$FCFECD)
ButtonGadget(30,10,10,100,30,"test #2")
CloseGadgetList()
AddTab(tc, 3, "Subtitles")
cont3 = ContainerGadget(#PB_Any,45,54,232,384)
tab(3) = cont3
SetGadgetColor(cont3,#PB_Gadget_BackColor,$FCFECD)
ButtonGadget(40,10,10,100,30,"test #3")
CloseGadgetList()
SetWindowLongPtr_(tc, #GWL_STYLE, GetWindowLongPtr_(tc, #GWL_STYLE) |#TCS_HOTTRACK)
For ntab = 0 To 3
HideGadget(tab(ntab),1)
Next
HideGadget(tab(0),0)
Repeat
EventID.i = WaitWindowEvent()
Select EventID
Case #PB_Event_CloseWindow
DeleteTabControl(tc)
Quit = 1
Case #WM_LBUTTONDOWN
If IsMouseOver(tc)
temp = SendMessage_(tc, #TCM_GETCURSEL, 0, 0)
For ntab = 0 To 3
HideGadget(tab(ntab),1)
Next
HideGadget(tab(temp),0)
EndIf
Case #PB_Event_Gadget
Select EventGadget()
Case 10,20,30,40
Debug EventGadget()
EndSelect
EndSelect
Until Quit = 1
EndIf