Up | Button | BitBtn | SpeedButton | CheckBox | ComboBox | Control | Edit | Memo | Font | GroupBox | Label | ListBox | PageControl | Panel | RadioButton | Bevel | ScrollBox | TabSheet | WinControl | Callback | Frame | WinControl | Form | Release Notes

 

  

 
PageControl

The PageControl class is derived from the WinControl class

access function : GetPageControl(name)

Attribute Access Type Description
pageCount R int number of pages of the control
activePage R/W string name of the active page. Note that the page name may change due to the localization.
activePageIndex R/W int zero indexed value for active page [0..pageCount-1]
onChange W callback called when user changes the text

 

Method Returns Description
getPage(name) TabSheet returns the named TabSheet control if found, else None. The name may be both the visible page caption (case sensitive) or the internal name (not case sensitive)

 

Defined PageControls Description
pcMain the right side main page control
pcOperation the page control on the Operation page
pcSettings the page control on the Settings page
pcService the page control on the Service page
pcServiceGeneral the page control on the Service.General page
pcServiceTdvCmd the page control on the Service.Communication page
pcServiceAdvanced the page control on the Service.Advanced page
Central.SetupPageControl the page control on the Service.General.Advanced.Central page
ImageView.pc the page control showing images in multi camera/image profiles

Example 1: Set History Tab Active, language independent version

mainPage = GetPageControl('pcMain')
mainPage.activePage = 'tsOperation'                 #sets active page by internal name
operationPage =  mainPage.getPage('tsOperation')    #get page by internal name
operationPage.activePage = 'tsHistory'              #set active page by caption
# to access the tab sheets of the operation page see Example 5

Example 2: Open Service - Activate Service.Advanced.Central

ExecuteCmd('AccessControl','Service=1')
mainPage = GetPageControl('pcMain')
mainPage.activePage = 'tsService'

mainPage = GetPageControl('pcService')
mainPage.activePage = 'tsAdvanced'

mainPage = GetPageControl('pcServiceAdvanced')
mainPage.activePage = 'tsCentral'

Example 3a: Access an Image's CustomPanel using PageControls

pc=GetPageControl('ImageView.pc')
ts=pc.getPage('Image')
cp=ts.getControl('CustomPanel')
cp.handle  # used to connect .Net OverlayPanel object

Example 3a: Access an Image's CustomPanel

iv=GetImageView()
cp=iv.getCustomPanel('Image')
cp.handle  # used to connect .Net OverlayPanel object

Example 4: Iterate all PageControls of Main form

def FindControls(name,type):
  ctrl=GetControl(name)
  for iter in ctrl.controls:
    if iter[0]==type:               #check for equal type, first item is type
      c=ctrl.getControl(iter[1])    #get the control, second item is name
      print c.type,c.name           #print found control

FindControls('','PageControl')      #find all page controls directly owned by main form
Console output:
PageControl pcMain
PageControl pcOperation
PageControl pcSettings
PageControl pcService
PageControl pcServiceGeneral
PageControl pcServiceTdvCmd
PageControl pcServiceAdvanced

Example 5: Get access to the PageControl of a plugin and to connect a .Net object to the window handle

operationPage = GetPageControl('pcOperation')   # get Operation page control
controlpage =  operationPage.getPage('Visualization') # retrieves the tabsheet of the visualisation plugin  
visualisationPanel = CreateVisualizationOverlay(controlpage.handle)   # connects the handle to a .Net object

Example 6: Hide HistoryList tab

operationPage = GetPageControl('pcOperation')   # get Operation page control
controlpage =  operationPage.getPage('History') # retrieves the tabsheet 
controlpage.tabVisible = 0

Example 6: Hide Unused tabs

def HideTabs():
  operationPage = GetPageControl('pcOperation')   # get Operation page control
  operationPage.getPage('History').tabVisible = 0
  operationPage.getPage('Curves').tabVisible = 0
  servicePage = GetPageControl('pcService')   # get Service page control
  servicePage.getPage('Actions').tabVisible=0
  servicePage.getPage('Scheduler').tabVisible=0
  servicePage.getPage('Communication').tabVisible=0
 
 

Scorpion Vision Version XII : Build 646 - Date: 20170225
Scorpion Vision Software® is a registered trademark of Tordivel AS.
Copyright © 2000 - 2017 Tordivel AS.