plotdialogsbase.pyΒΆ

This script provides the Python code for the plot-based graphical user interfaces created with the wxFormBuilder (wxFB) template PlotDialogs.fbp.

These dialogs can be used together with the Narda Script Launcher application for multithreaded processes.

Note

Do not edit the base dialog script plotdialogsbase.py.

To add/remove widgets in the dialogs, modify the template PlotDialogs.fbp in wxFormBuilder.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# -*- coding: utf-8 -*-

###########################################################################
## Python code generated with wxFormBuilder (version Oct 26 2018)
## http://www.wxformbuilder.org/
##
## PLEASE DO *NOT* EDIT THIS FILE!
###########################################################################

from nardascripting.base.measthread import DataVisualizationDlg
import wx
import wx.xrc

###########################################################################
## Class PlotSettingsBaseDlg
###########################################################################

class PlotSettingsBaseDlg ( wx.Dialog ):

	def __init__( self, parent ):
		wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"My Settings", pos = wx.DefaultPosition, size = wx.Size( 698,587 ), style = wx.DEFAULT_DIALOG_STYLE )

		self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )
		self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_INACTIVEBORDER ) )

		bSizer1 = wx.BoxSizer( wx.VERTICAL )

		self.m_panel1 = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.BORDER_SUNKEN|wx.TAB_TRAVERSAL )
		self.m_panel1.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_HIGHLIGHTTEXT ) )

		bSizer2 = wx.BoxSizer( wx.VERTICAL )

		self.lbl_my_label = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Example content.", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.lbl_my_label.Wrap( -1 )

		bSizer2.Add( self.lbl_my_label, 0, wx.ALL, 5 )

		self.btn_my_button = wx.Button( self.m_panel1, wx.ID_ANY, u"click me", wx.DefaultPosition, wx.DefaultSize, 0 )
		bSizer2.Add( self.btn_my_button, 0, wx.ALL, 5 )


		self.m_panel1.SetSizer( bSizer2 )
		self.m_panel1.Layout()
		bSizer2.Fit( self.m_panel1 )
		bSizer1.Add( self.m_panel1, 1, wx.EXPAND |wx.ALL, 5 )

		my_ok_cancel_btns = wx.StdDialogButtonSizer()
		self.my_ok_cancel_btnsOK = wx.Button( self, wx.ID_OK )
		my_ok_cancel_btns.AddButton( self.my_ok_cancel_btnsOK )
		self.my_ok_cancel_btnsCancel = wx.Button( self, wx.ID_CANCEL )
		my_ok_cancel_btns.AddButton( self.my_ok_cancel_btnsCancel )
		my_ok_cancel_btns.Realize();

		bSizer1.Add( my_ok_cancel_btns, 0, wx.EXPAND, 5 )


		self.SetSizer( bSizer1 )
		self.Layout()

		self.Centre( wx.BOTH )

		# Connect Events
		self.btn_my_button.Bind( wx.EVT_LEFT_DOWN, self.on_my_button_clicked )
		self.my_ok_cancel_btnsCancel.Bind( wx.EVT_BUTTON, self.on_cancel )
		self.my_ok_cancel_btnsOK.Bind( wx.EVT_BUTTON, self.on_ok )

	def __del__( self ):
		pass


	# Virtual event handlers, overide them in your derived class
	def on_my_button_clicked( self, event ):
		event.Skip()

	def on_cancel( self, event ):
		event.Skip()

	def on_ok( self, event ):
		event.Skip()


###########################################################################
## Class PlotBaseDlg
###########################################################################

class PlotBaseDlg ( DataVisualizationDlg ):

	def __init__( self, parent ):
		DataVisualizationDlg.__init__ ( self, parent, id = wx.ID_ANY, title = u"My Measurement", pos = wx.DefaultPosition, size = wx.Size( 729,636 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )

		self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )
		self.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_INACTIVEBORDER ) )

		bSizer3 = wx.BoxSizer( wx.VERTICAL )

		self.pnl_plot_container = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.BORDER_SUNKEN|wx.TAB_TRAVERSAL )
		self.pnl_plot_container.SetForegroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOWTEXT ) )
		self.pnl_plot_container.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOW ) )

		self.szr_plot = wx.BoxSizer( wx.VERTICAL )


		self.pnl_plot_container.SetSizer( self.szr_plot )
		self.pnl_plot_container.Layout()
		self.szr_plot.Fit( self.pnl_plot_container )
		bSizer3.Add( self.pnl_plot_container, 1, wx.EXPAND|wx.ALL, 10 )

		fgSizer1 = wx.FlexGridSizer( 0, 2, 0, 0 )
		fgSizer1.AddGrowableCol( 1 )
		fgSizer1.SetFlexibleDirection( wx.BOTH )
		fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )

		self.bmp_icon = wx.StaticBitmap( self, wx.ID_ANY, wx.NullBitmap, wx.DefaultPosition, wx.DefaultSize, 0 )
		fgSizer1.Add( self.bmp_icon, 0, wx.ALL, 5 )

		self.lbl_status = wx.StaticText( self, wx.ID_ANY, u"Status Label", wx.DefaultPosition, wx.DefaultSize, 0 )
		self.lbl_status.Wrap( -1 )

		fgSizer1.Add( self.lbl_status, 0, wx.ALL, 5 )


		fgSizer1.Add( ( 0, 0), 1, wx.EXPAND, 5 )

		self.pgb_progress = wx.Gauge( self, wx.ID_ANY, 100, wx.DefaultPosition, wx.DefaultSize, wx.GA_HORIZONTAL )
		self.pgb_progress.SetValue( 0 )
		self.pgb_progress.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_INACTIVEBORDER ) )

		fgSizer1.Add( self.pgb_progress, 0, wx.ALL, 5 )


		bSizer3.Add( fgSizer1, 0, wx.EXPAND, 5 )

		self.sdbs_buttons = wx.StdDialogButtonSizer()
		self.sdbs_buttons.Realize();

		bSizer3.Add( self.sdbs_buttons, 0, wx.ALL|wx.EXPAND, 10 )


		self.SetSizer( bSizer3 )
		self.Layout()

		self.Centre( wx.BOTH )

	def __del__( self ):
		pass


download example04.zip