| ||||||
| The CentralPluginPage module gives access to user defined
plugin pages in Central.
Attributes of the CentralPluginPage class
pluginOverlay = CreatePluginOverlay(GetCentralPluginPage('Plugin').handle)
pluginpage=GetCentralPluginPage('Plugin')
pluginOverlay.Height = pluginpage.height-pluginpage.plugin.height
pluginOverlay.Top = pluginpage.plugin.height
More information about .Net Controls in Scorpion To configure the
Central Plugin Page
def CreatePluginOverlay(hwnd):
import CLR
import CLR.System.Windows.Forms as WinForms
from CLR.System.Drawing import Size, Point
# Load custom assemblies
from CLR.System.Reflection import Assembly
Assembly.LoadFrom('OverlayPanel.dll')
from CLR.Tordivel import OverlayPanel
class DataInputOverlay(OverlayPanel):
def __init__(self,nativeParentHandleAsInt32):
# Enable ShowTrace for debug help
#self.ShowTrace = 1
# Use border just to be able to see the extent of the overlay panel
self.BorderStyle = WinForms.BorderStyle.None
# The Dock property can have one of the following DockStyle values: None, Left, Top, Right, Botton and Fill
# In this demo we dock to bottom, height of 50. The Plugin is from Central Setup anchored
# to match this.
self.Height = 50
self.Dock = WinForms.DockStyle.Bottom
# Create the Today button
self.Today = WinForms.Button()
self.Today.Parent = self
self.Today.Size = Size(80,24)
self.Today.Location = Point(10,10)
self.Today.Text = "Today"
# Register event handler for Today.Click
self.Today.Click += self.Today_ClickHandler
# Create the PrevDay button
self.PrevDay = WinForms.Button()
self.PrevDay.Parent = self
self.PrevDay.Size = Size(80,24)
self.PrevDay.Location = Point(100,10)
self.PrevDay.Text = "Prev day"
# Register event handler for PrevDay.Click
self.PrevDay.Click += self.PrevDay_ClickHandler
# Create the NextDay button
self.NextDay = WinForms.Button()
self.NextDay.Parent = self
self.NextDay.Size = Size(80,24)
self.NextDay.Location = Point(190,10)
self.NextDay.Text = "Next day"
# Register event handler for NextDay.Click
self.NextDay.Click += self.NextDay_ClickHandler
# Create the PrevMonth button
self.PrevMonth = WinForms.Button()
self.PrevMonth.Parent = self
self.PrevMonth.Size = Size(80,24)
self.PrevMonth.Location = Point(280,10)
self.PrevMonth.Text = "Prev month"
# Register event handler for PrevMonth.Click
self.PrevMonth.Click += self.PrevMonth_ClickHandler
# Create the NextMonth button
self.NextMonth = WinForms.Button()
self.NextMonth.Parent = self
self.NextMonth.Size = Size(80,24)
self.NextMonth.Location = Point(370,10)
self.NextMonth.Text = "Next month"
# Register event handler for NextMonth.Click
self.NextMonth.Click += self.NextMonth_ClickHandler
#Button Click handlers
def Today_ClickHandler(self, sender, args):
# Handles the Day Click event
Plugin.Today()
def NextDay_ClickHandler(self, sender, args):
# Handles the NextDay Click event
val=int(Plugin.GetDay().split('=')[1])
Plugin.SetDay('Value='+str(val+1))
def PrevDay_ClickHandler(self, sender, args):
# Handles the PrevDay Click event
val=int(Plugin.GetDay().split('=')[1])
Plugin.SetDay('Value='+str(val-1))
def PrevMonth_ClickHandler(self, sender, args):
# Handles the PrevDay Click event
val=int(Plugin.GetMonth().split('=')[1])
if val>1:Plugin.SetMonth('Value='+str(val-1))
def NextMonth_ClickHandler(self, sender, args):
# Handles the PrevDay Click event
val=int(Plugin.GetMonth().split('=')[1])
if val<12:Plugin.SetMonth('Value='+str(val+1))
return DataInputOverlay(hwnd)
|
|