This repository has been archived by the owner on Mar 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Window1.rbfrm
1377 lines (1343 loc) · 37.6 KB
/
Window1.rbfrm
1
#tag WindowBegin Window Window1 BackColor = 16777215 Backdrop = 0 BalloonHelp = "" CloseButton = True Composite = False Frame = 0 FullScreen = False HasBackColor = False Height = 591 ImplicitInstance= True LiveResize = True MacProcID = 0 MaxHeight = 32000 MaximizeButton = True MaxWidth = 32000 MenuBar = -1128000497 MenuBarVisible = True MinHeight = 591 MinimizeButton = True MinWidth = 536 Placement = 0 Resizeable = True Title = "Graph" Visible = True Width = 536 Begin Canvas Canvas1 AcceptFocus = False AcceptTabs = False AutoDeactivate = True Backdrop = 0 DoubleBuffer = False Enabled = True EraseBackground = True Height = 194 HelpTag = "" Index = -2147483648 InitialParent = "" Left = 196 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False Scope = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True Top = 395 UseFocusRing = True Visible = True Width = 167 Begin AlternatingList values AutoDeactivate = True AutoHideScrollbars= True Bold = False Border = True ColumnCount = 2 ColumnsResizable= False ColumnWidths = "" DataField = "" DataSource = "" DefaultRowHeight= 16 Enabled = True EnableDrag = False EnableDragReorder= False GridLinesHorizontal= 0 GridLinesVertical= 0 HasHeading = True HeadingIndex = -1 Height = 154 HelpTag = "" Hierarchical = False Index = -2147483648 InitialParent = "Canvas1" InitialValue = "X Y" Italic = False Left = 201 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False RequiresSelection= "" Scope = 0 ScrollbarHorizontal= False ScrollBarVertical= True SelectionType = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 11 TextUnit = 0 Top = 401 Underline = False UseFocusRing = True Visible = True Width = 152 _ScrollOffset = 0 _ScrollWidth = -1 End Begin BevelButton BevelButton3 AcceptFocus = "" AutoDeactivate = True BackColor = 0 Bevel = 5 Bold = False ButtonType = 0 Caption = "+" CaptionAlign = 3 CaptionDelta = 0 CaptionPlacement= 1 Enabled = True HasBackColor = "" HasMenu = 0 Height = 22 HelpTag = "" Icon = 0 IconAlign = 0 IconDX = 0 IconDY = 0 Index = -2147483648 InitialParent = "Canvas1" Italic = False Left = 331 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False MenuValue = 0 Scope = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True TextColor = 0 TextFont = "System" TextSize = 12 TextUnit = "" Top = 559 Underline = False Value = False Visible = True Width = 22 End Begin BevelButton BevelButton4 AcceptFocus = "" AutoDeactivate = True BackColor = 0 Bevel = 5 Bold = False ButtonType = 0 Caption = "-" CaptionAlign = 3 CaptionDelta = 0 CaptionPlacement= 1 Enabled = True HasBackColor = "" HasMenu = 0 Height = 22 HelpTag = "" Icon = 0 IconAlign = 0 IconDX = 0 IconDY = 0 Index = -2147483648 InitialParent = "Canvas1" Italic = False Left = 302 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False MenuValue = 0 Scope = 0 TabIndex = 1 TabPanelIndex = 0 TabStop = True TextColor = 0 TextFont = "System" TextSize = 12 TextUnit = "" Top = 559 Underline = False Value = False Visible = True Width = 22 End End Begin StaticText StaticText1 AutoDeactivate = True Bold = False DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = False Left = 20 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False Multiline = False Scope = 0 Selectable = False TabIndex = 1 TabPanelIndex = 0 Text = "Graph Name:" TextAlign = 2 TextColor = 0 TextFont = "System" TextSize = 11 TextUnit = 0 Top = 321 Transparent = False Underline = False Visible = True Width = 70 End Begin TextField graphName AcceptTabs = False Alignment = 0 AutoDeactivate = True BackColor = 16777215 Bold = False Border = True DataField = "" DataSource = "" Enabled = True Format = "" Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = False Left = 92 LimitText = 0 LockBottom = True LockedInPosition= False LockLeft = True LockRight = True LockTop = False Mask = "" Multiline = False Password = False ReadOnly = False Scope = 0 ScrollbarHorizontal= False ScrollbarVertical= True Styled = False TabIndex = 2 TabPanelIndex = 0 TabStop = True Text = "" TextColor = 0 TextFont = "System" TextSize = 11 TextUnit = 0 Top = 321 Underline = False UseFocusRing = True Visible = True Width = 347 End Begin StaticText StaticText2 AutoDeactivate = True Bold = False DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = False Left = 20 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False Multiline = False Scope = 0 Selectable = False TabIndex = 3 TabPanelIndex = 0 Text = "X Label:" TextAlign = 2 TextColor = 0 TextFont = "System" TextSize = 11 TextUnit = 0 Top = 348 Transparent = False Underline = False Visible = True Width = 70 End Begin TextField xlabel AcceptTabs = False Alignment = 0 AutoDeactivate = True BackColor = 16777215 Bold = False Border = True DataField = "" DataSource = "" Enabled = True Format = "" Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = False Left = 92 LimitText = 0 LockBottom = True LockedInPosition= False LockLeft = True LockRight = True LockTop = False Mask = "" Multiline = False Password = False ReadOnly = False Scope = 0 ScrollbarHorizontal= False ScrollbarVertical= True Styled = False TabIndex = 4 TabPanelIndex = 0 TabStop = True Text = "" TextColor = 0 TextFont = "System" TextSize = 11 TextUnit = 0 Top = 348 Underline = False UseFocusRing = True Visible = True Width = 347 End Begin StaticText StaticText3 AutoDeactivate = True Bold = False DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = False Left = 20 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False Multiline = False Scope = 0 Selectable = False TabIndex = 5 TabPanelIndex = 0 Text = "Y Label:" TextAlign = 2 TextColor = 0 TextFont = "System" TextSize = 11 TextUnit = 0 Top = 375 Transparent = False Underline = False Visible = True Width = 70 End Begin TextField ylabel AcceptTabs = False Alignment = 0 AutoDeactivate = True BackColor = 16777215 Bold = False Border = True DataField = "" DataSource = "" Enabled = True Format = "" Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = False Left = 92 LimitText = 0 LockBottom = True LockedInPosition= False LockLeft = True LockRight = True LockTop = False Mask = "" Multiline = False Password = False ReadOnly = False Scope = 0 ScrollbarHorizontal= False ScrollbarVertical= True Styled = False TabIndex = 6 TabPanelIndex = 0 TabStop = True Text = "" TextColor = 0 TextFont = "System" TextSize = 11 TextUnit = 0 Top = 375 Underline = False UseFocusRing = True Visible = True Width = 424 End Begin AlternatingList series AutoDeactivate = True AutoHideScrollbars= True Bold = False Border = True ColumnCount = 2 ColumnsResizable= False ColumnWidths = "80%" DataField = "" DataSource = "" DefaultRowHeight= 16 Enabled = True EnableDrag = False EnableDragReorder= False GridLinesHorizontal= 0 GridLinesVertical= 0 HasHeading = True HeadingIndex = -1 Height = 154 HelpTag = "" Hierarchical = False Index = -2147483648 InitialParent = "" InitialValue = "Serie Col" Italic = False Left = 20 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False RequiresSelection= "" Scope = 0 ScrollbarHorizontal= False ScrollBarVertical= True SelectionType = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 11 TextUnit = 0 Top = 401 Underline = False UseFocusRing = True Visible = True Width = 165 _ScrollOffset = 0 _ScrollWidth = -1 End Begin BevelButton BevelButton1 AcceptFocus = "" AutoDeactivate = True BackColor = 0 Bevel = 5 Bold = False ButtonType = 0 Caption = "+" CaptionAlign = 3 CaptionDelta = 0 CaptionPlacement= 1 Enabled = True HasBackColor = "" HasMenu = 0 Height = 22 HelpTag = "" Icon = 0 IconAlign = 0 IconDX = 0 IconDY = 0 Index = -2147483648 InitialParent = "" Italic = False Left = 163 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False MenuValue = 0 Scope = 0 TabIndex = 7 TabPanelIndex = 0 TabStop = True TextColor = 0 TextFont = "System" TextSize = 12 TextUnit = "" Top = 559 Underline = False Value = False Visible = True Width = 22 End Begin BevelButton BevelButton2 AcceptFocus = "" AutoDeactivate = True BackColor = 0 Bevel = 5 Bold = False ButtonType = 0 Caption = "-" CaptionAlign = 3 CaptionDelta = 0 CaptionPlacement= 1 Enabled = True HasBackColor = "" HasMenu = 0 Height = 22 HelpTag = "" Icon = 0 IconAlign = 0 IconDX = 0 IconDY = 0 Index = -2147483648 InitialParent = "" Italic = False Left = 134 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False MenuValue = 0 Scope = 0 TabIndex = 8 TabPanelIndex = 0 TabStop = True TextColor = 0 TextFont = "System" TextSize = 12 TextUnit = "" Top = 559 Underline = False Value = False Visible = True Width = 22 End Begin UpDownArrows LittleArrows1 AcceptFocus = "" AutoDeactivate = True Enabled = True Height = 32 HelpTag = "" Index = -2147483648 InitialParent = "" Left = 520 LockBottom = "" LockedInPosition= False LockLeft = "" LockRight = "" LockTop = "" Scope = 0 TabIndex = 0 TabPanelIndex = 0 TabStop = True Top = 292 Visible = True Width = 32 End Begin Canvas axes AcceptFocus = False AcceptTabs = False AutoDeactivate = True Backdrop = 0 DoubleBuffer = False Enabled = True EraseBackground = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Left = 370 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False Scope = 0 TabIndex = 9 TabPanelIndex = 0 TabStop = True Top = 401 UseFocusRing = True Visible = True Width = 20 End Begin StaticText StaticText4 AutoDeactivate = True Bold = False DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = False Left = 393 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False Multiline = False Scope = 0 Selectable = False TabIndex = 10 TabPanelIndex = 0 Text = "Axis Color" TextAlign = 0 TextColor = 0 TextFont = "System" TextSize = 11 TextUnit = 0 Top = 401 Transparent = False Underline = False Visible = True Width = 100 End Begin Canvas labels AcceptFocus = False AcceptTabs = False AutoDeactivate = True Backdrop = 0 DoubleBuffer = False Enabled = True EraseBackground = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Left = 370 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False Scope = 0 TabIndex = 11 TabPanelIndex = 0 TabStop = True Top = 426 UseFocusRing = True Visible = True Width = 20 End Begin StaticText StaticText5 AutoDeactivate = True Bold = False DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = False Left = 393 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False Multiline = False Scope = 0 Selectable = False TabIndex = 12 TabPanelIndex = 0 Text = "Label Color" TextAlign = 0 TextColor = 0 TextFont = "System" TextSize = 11 TextUnit = 0 Top = 426 Transparent = False Underline = False Visible = True Width = 100 End Begin PushButton bSaveGraph AutoDeactivate = True Bold = False Cancel = False Caption = "Save Graph" Default = False Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = False Left = 394 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False Scope = 0 TabIndex = 13 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 11 TextUnit = 0 Top = 465 Underline = False Visible = True Width = 80 End Begin PushButton bSave AutoDeactivate = True Bold = False Cancel = False Caption = "Save Data" Default = False Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = False Left = 394 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False Scope = 0 TabIndex = 14 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 11 TextUnit = 0 Top = 497 Underline = False Visible = True Width = 80 End Begin PushButton bLoad AutoDeactivate = True Bold = False Cancel = False Caption = "Load Data" Default = False Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = False Left = 394 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False Scope = 0 TabIndex = 15 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 11 TextUnit = 0 Top = 529 Underline = False Visible = True Width = 80 End Begin PushButton bReset AutoDeactivate = True Bold = False Cancel = False Caption = "Reset" Default = False Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = False Left = 394 LockBottom = True LockedInPosition= False LockLeft = True LockRight = False LockTop = False Scope = 0 TabIndex = 16 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 11 TextUnit = 0 Top = 561 Underline = False Visible = True Width = 80 End Begin CheckBox CheckBox1 AutoDeactivate = True Bold = False Caption = "Captions" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = False Left = 445 LockBottom = True LockedInPosition= False LockLeft = False LockRight = True LockTop = False Scope = 0 State = 1 TabIndex = 17 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 11 TextUnit = 0 Top = 321 Underline = False Value = True Visible = True Width = 71 End Begin CheckBox CheckBox2 AutoDeactivate = True Bold = False Caption = "Zero" DataField = "" DataSource = "" Enabled = True Height = 20 HelpTag = "" Index = -2147483648 InitialParent = "" Italic = False Left = 445 LockBottom = True LockedInPosition= False LockLeft = False LockRight = True LockTop = False Scope = 0 State = 0 TabIndex = 18 TabPanelIndex = 0 TabStop = True TextFont = "System" TextSize = 11 TextUnit = 0 Top = 348 Underline = False Value = False Visible = True Width = 71 End Begin GraphCanvas GraphCanvas1 AcceptFocus = False AcceptTabs = False AutoDeactivate = True Backdrop = 0 DoubleBuffer = False Enabled = True EraseBackground = True Height = 301 HelpTag = "" Index = -2147483648 InitialParent = "" Left = 20 LockBottom = True LockedInPosition= False LockLeft = True LockRight = True LockTop = True Scope = 0 TabIndex = 19 TabPanelIndex = 0 TabStop = True Top = 14 UseFocusRing = True Visible = True Width = 496 EndEnd#tag EndWindow#tag WindowCode #tag MenuHandler Function AppleAbout() As Boolean Handles AppleAbout.Action msgBox "©Alex Restrepo 2004" End Function #tag EndMenuHandler #tag MenuHandler Function EditCopy() As Boolean Handles EditCopy.Action dim c as clipboard c=new clipboard c.picture=graphcanvas1.getPicture End Function #tag EndMenuHandler #tag Method, Flags = &h0 Sub addSeries() Const PI=3.14159265358979323846264338327950 dim i as integer dim x, y, Increment as double dim tmp, tmp2 as dataset series.addrow "New Series" series.cell(series.lastIndex,1)=" " tmp=new DataSet("New Series",rgb(rnd*255,rnd*255,rnd*255)) series.celltag(series.lastIndex,0)=tmp 'series.addrow "New Series" 'series.cell(series.lastIndex,1)=" " 'tmp2=new DataSet("New Series",rgb(rnd*255,rnd*255,rnd*255)) 'series.celltag(series.lastIndex,0)=tmp2 ' 'x=-PI 'increment=PI/25 'for i=1 to 50 'y=sin(x) 'tmp.addValue(x,y) 'y=cos(x) 'tmp2.addValue(x,y) 'x=x+increment 'next graphcanvas1.addSet(tmp) 'graphcanvas1.addSet(tmp2) End Sub #tag EndMethod #tag Property, Flags = &h0 clickedCellColumn As integer #tag EndProperty #tag Property, Flags = &h0 clickedCellRow As integer #tag EndProperty #tag Property, Flags = &h1 Protected currTickMarks As integer #tag EndProperty #tag Property, Flags = &h0 lastName As string #tag EndProperty #tag Property, Flags = &h0 selectedSet As dataSet #tag EndProperty#tag EndWindowCode#tag Bindings #tag BeginBinding SourceItem = xlabel DestinationItem = series ItemType = enablingBinder ItemDescription = Enable BevelButton2 when series has a selection SourceBindData = getSelectionProvider SourceData = 0 #tag EndBinding #tag BeginBinding SourceItem = xlabel DestinationItem = Canvas1 ItemType = enablingBinder ItemDescription = Enable Canvas1 when series has a selection SourceBindData = getSelectionProvider SourceData = 0 #tag EndBinding #tag BeginBinding SourceItem = StaticText3 DestinationItem = BevelButton2 ItemType = enablingBinder ItemDescription = Enable BevelButton4 when values has a selection SourceBindData = getSelectionProvider SourceData = 1 #tag EndBinding#tag EndBindings#tag Events values #tag Event Function CellKeyDown(row as Integer, column as Integer, key as String) As Boolean '48+57 if asc(key)>=48 and asc(key)<=57 or asc(key)=9 or asc(key)=8 or key="." or key="," or key="-" or asc(key)=13 then return false else beep return true end if End Function #tag EndEvent #tag Event Sub CellAction(row As Integer, column As Integer) if me.cell(row,column).trim="" then me.cell(row,column)="0" end if if column=0 then selectedSet.xvalue(row)=val(me.cell(row,column)) else selectedSet.yvalue(row)=val(me.cell(row,column)) end if me.celltype(row,column)=0 graphcanvas1.forceUpdate End Sub #tag EndEvent #tag Event Function CellClick(row as integer, column as integer, x as integer, y as integer) As boolean clickedCellRow=row clickedCellColumn=column End Function #tag EndEvent #tag Event Sub DoubleClick() if me.listindex<0 then return me.celltype(clickedCellRow,clickedCellColumn)=3 me.editCell(clickedCellRow,clickedCellColumn) me.activecell.selstart=0 me.activecell.sellength=me.activecell.text.len End Sub #tag EndEvent#tag EndEvents#tag Events BevelButton3 #tag Event Sub Action() if values.listcount=0 then values.addRow "0" else values.addRow str(values.lastIndex+1) end if values.cell(values.lastIndex,1)=str(values.lastIndex) selectedSet.addValue(values.lastIndex,values.lastIndex) graphcanvas1.forceUpdate End Sub #tag EndEvent#tag EndEvents#tag Events BevelButton4 #tag Event Sub Action() selectedSet.removeRow values.listindex values.removeRow values.listindex graphcanvas1.forceUpdate End Sub #tag EndEvent#tag EndEvents#tag Events graphName #tag Event Sub Open() me.text=graphcanvas1.graphname End Sub #tag EndEvent #tag Event Sub TextChange() graphcanvas1.graphName=me.text End Sub #tag EndEvent#tag EndEvents#tag Events xlabel #tag Event Sub Open() me.text=graphcanvas1.xlabel End Sub #tag EndEvent #tag Event Sub TextChange() graphcanvas1.xlabel=me.text End Sub #tag EndEvent#tag EndEvents#tag Events ylabel #tag Event Sub Open() me.text=graphcanvas1.ylabel End Sub #tag EndEvent #tag Event Sub TextChange() graphcanvas1.ylabel=me.text End Sub #tag EndEvent#tag EndEvents#tag Events series #tag Event Function CellTextPaint(g as graphics, row as integer, column as integer, x as integer, y as integer) As boolean dim tmp as dataSet if column=1 then tmp=me.celltag(row,0) g.foreColor=tmp.getColor g.fillrect 2,2,g.width-6,g.height-4 g.foreColor=&c000000 g.drawrect 2,2,g.width-6,g.height-4 end if End Function #tag EndEvent #tag Event Sub CellAction(row As Integer, column As Integer) dim tmp as dataset if me.cell(row,column).trim="" then me.cell(row,column)=lastname else tmp=me.celltag(row,0) tmp.name=me.cell(row,column) graphcanvas1.forceUpdate end if me.celltype(row,column)=0 End Sub #tag EndEvent #tag Event Sub DoubleClick() if me.listindex<0 then return me.celltype(me.listindex,0)=3 me.editCell(me.listindex,0) me.activecell.selstart=0 me.activecell.sellength=me.activecell.text.len End Sub #tag EndEvent #tag Event Function CellClick(row as integer, column as integer, x as integer, y as integer) As boolean dim newc as color dim tmp as dataset if column=0 then lastName=me.cell(row,column) elseif column=1 then tmp=me.celltag(row,0) newc=tmp.getColor if selectColor(newc,"Choose a new line color.") then tmp.setColor(newc) me.invalidateCell(row,1) graphcanvas1.forceUpdate end if end if End Function #tag EndEvent #tag Event Sub Change() dim i as integer if me.listindex<0 then return selectedSet=me.celltag(me.listindex,0) values.deleteAllRows for i=0 to selectedSet.count-1 values.addrow str(selectedSet.xvalue(i)) values.cell(values.lastIndex,1)=str(selectedSet.yvalue(i)) next End Sub #tag EndEvent#tag EndEvents#tag Events BevelButton1 #tag Event Sub Action() addSeries End Sub #tag EndEvent#tag EndEvents#tag Events BevelButton2 #tag Event Sub Action() graphcanvas1.removeSet series.listindex series.removeRow series.listindex End Sub #tag EndEvent#tag EndEvents#tag Events LittleArrows1 #tag Event Sub Up() currTickMarks=currtickMarks+1 if currtickMarks>graphcanvas1.maxCount then currTickMarks=graphcanvas1.maxCount graphcanvas1.tickMarks=currtickMarks graphcanvas1.forceUpdate End Sub #tag EndEvent #tag Event Sub Down() currTickMarks=currtickMarks-1 if currtickMarks<0 then currTickMarks=0 graphcanvas1.tickMarks=currtickMarks graphcanvas1.forceUpdate End Sub #tag EndEvent#tag EndEvents#tag Events axes #tag Event Function MouseDown(X As Integer, Y As Integer) As Boolean dim newc as color newc=graphcanvas1.axisColor if selectcolor(newc,"Select new axe color.") then graphcanvas1.axisColor=newc end if me.refresh End Function #tag EndEvent #tag Event Sub Paint(g As Graphics) g.foreColor=graphcanvas1.axisColor g.fillrect 0,0,g.width,g.height g.foreColor=&c000000 g.drawrect 0,0,g.width,g.height End Sub #tag EndEvent#tag EndEvents#tag Events labels #tag Event Function MouseDown(X As Integer, Y As Integer) As Boolean dim newc as color newc=graphcanvas1.labelColor if selectcolor(newc,"Select new label color.") then graphcanvas1.labelColor=newc end if me.refresh End Function #tag EndEvent #tag Event Sub Paint(g As Graphics) g.foreColor=graphcanvas1.labelColor g.fillrect 0,0,g.width,g.height g.foreColor=&c000000 g.drawrect 0,0,g.width,g.height End Sub #tag EndEvent#tag EndEvents#tag Events bSaveGraph #tag Event Sub Action() dim fi as folderItem #if targetMacOS then fi=getSaveFolderItem("pict",graphcanvas1.graphname) #else fi=getSaveFolderItem("bmp",graphcanvas1.graphname) #endif if fi<>nil then fi.saveaspicture graphcanvas1.getPicture end if End Sub #tag EndEvent#tag EndEvents#tag Events bSave #tag Event Sub Action() dim fi as folderItem fi=getSaveFolderItem("xml",graphcanvas1.graphName+".xml") if fi<>nil then graphcanvas1.save(fi) end if End Sub #tag EndEvent#tag EndEvents#tag Events bLoad #tag Event Sub Action() dim fi as folderitem dim tmp() as dataset dim i as integer fi=getOpenFolderItem("xml") if fi<>nil then if graphcanvas1.load(fi) then series.deleteAllRows values.deleteAllRows graphname.text=graphcanvas1.graphname xlabel.text=graphcanvas1.xLabel ylabel.text=graphcanvas1.yLabel tmp=graphcanvas1.getSets for i=0 to ubound(tmp) series.addrow tmp(i).name series.cell(series.lastIndex,1)=" " series.celltag(series.lastIndex,0)=tmp(i) next refresh else msgBox "Invalid file format." end if end if End Sub #tag EndEvent#tag EndEvents#tag Events bReset #tag Event Sub Action() graphcanvas1.reset series.deleteAllRows values.deleteAllRows graphName.text="" xlabel.text="" ylabel.text="" End Sub #tag EndEvent#tag EndEvents#tag Events CheckBox1 #tag Event Sub Action() graphcanvas1.showCaptions=me.value End Sub #tag EndEvent#tag EndEvents#tag Events CheckBox2 #tag Event Sub Open() me.value=graphcanvas1.showzero End Sub #tag EndEvent #tag Event Sub Action() graphcanvas1.showZero=me.value End Sub #tag EndEvent#tag EndEvents#tag Events GraphCanvas1 #tag Event Sub Paint(g as graphics) g.drawrect 0,0,g.width,g.height End Sub #tag EndEvent #tag Event Function FormatValue(value as double, yaxis as boolean) As string return format(value,"-#.0#") End Function #tag EndEvent#tag EndEvents