forked from alexrestrepo/RBCustomTabPanel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtabsCCDemo.rbfrm
183 lines (171 loc) · 4.68 KB
/
tabsCCDemo.rbfrm
1
#tag WindowBegin ContainerControl tabsCCDemo AcceptFocus = "" AcceptTabs = "" AutoDeactivate = True Enabled = True EraseBackground = True Height = 400 HelpTag = "" InitialParent = "" Left = 32 LockBottom = True LockLeft = True LockRight = True LockTop = True TabIndex = 0 TabPanelIndex = 0 TabStop = True Top = 32 UseFocusRing = "" Visible = True Width = 400 Begin CustomTabPanelTabs tabs AcceptFocus = "" AcceptTabs = "" AutoDeactivate = True Backdrop = "" DoubleBuffer = False Enabled = True enableTabReordering= True EraseBackground = True Facing = 0 Height = 27 HelpTag = "" Index = -2147483648 InitialParent = "" Left = 30 LockBottom = "" LockedInPosition= False LockLeft = "" LockRight = "" LockTop = "" Scope = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True Top = 21 UseFocusRing = True Visible = True Width = 27 End Begin PagePanel tabPages AutoDeactivate = True Enabled = True Height = 100 HelpTag = "" Index = -2147483648 InitialParent = "" Left = 47 LockBottom = True LockedInPosition= False LockLeft = True LockRight = True LockTop = True PanelCount = 0 Panels = "" Scope = 0 TabIndex = 1 TabPanelIndex = 0 Top = 150 Value = -1 Visible = True Width = 100 EndEnd#tag EndWindow#tag WindowCode #tag Method, Flags = &h0 Sub Constructor(facing as integer) //I do this here for demo purposes... //you can always set these up using the window editor. tabs.Facing=facing select case facing case NORTH tabs.top=0 tabs.Left=0 tabs.Width=me.Width tabPages.Left=0 tabPages.Top=tabs.Height tabPages.Width=me.Width tabPages.Height=me.Height-tabs.Height tabs.LockLeft=true tabs.LockRight=true tabs.LockTop=true case SOUTH tabs.top=me.Height-tabs.Height-5 tabs.Left=0 tabs.Width=me.Width tabPages.Left=0 tabPages.Top=0 tabPages.Width=me.Width tabPages.Height=me.Height-tabs.Height-5 tabs.LockLeft=true tabs.LockRight=true tabs.LockBottom=true case EAST tabs.top=0 tabs.Left=Width-tabs.Width tabs.Height=me.Height tabPages.Left=0 tabPages.Top=0 tabPages.Width=me.Width-tabs.Width tabPages.Height=me.Height tabs.Lockright=true tabs.Locktop=true tabs.LockBottom=true case WEST tabs.top=0 tabs.Left=0 tabs.Height=me.Height tabPages.Left=tabs.Width tabPages.Top=0 tabPages.Width=me.Width-tabs.Width tabPages.Height=me.Height tabs.Lockleft=true tabs.Locktop=true tabs.LockBottom=true End Select End Sub #tag EndMethod#tag EndWindowCode#tag Events tabs #tag Event Sub Open() me.attachPanel(tabPages) me.appendTab("Test tab 1",icondata,true) me.appendTab("Test tab 2",icondata,true) me.appendTab("Test tab 3",icondata,true) me.appendTab("Test tab 4",icondata,true) me.appendTab("Test tab 5",icondata,true) me.appendTab("Test tab 6",icondata,true) me.appendTab("Test tab 7",icondata,true) me.value=0 End Sub #tag EndEvent #tag Event Sub PanelPageAdded(panel as pagePanel, page as integer) dim tabName as String=me.caption(page) dim container as ContainerControl Container=new dummyControl(tabName) container.embedWithinPanel(panel,page) container.left=panel.Left container.top=panel.top container.width=Panel.Width container.height=panel.height End Sub #tag EndEvent #tag Event Function CancelRemoveTab(tabIndex as integer) As boolean if not facingsDemo.confirm.Value then Return False Dim n as Integer n=MsgBox ("Do you really want to remove this tab?",36) Return n<>6 End Function #tag EndEvent #tag Event Sub TabContextualMenuAction(tab as CustomTab, menu as MenuItem) MsgBox Menu.Text End Sub #tag EndEvent#tag EndEvents