David Higgs
Programmer
Over the years I’ve been developing an application for my Amateur Radio activities. The project, although it meets my current requirements has become rather cumbersome with code placed here there and everywhere.
As my thoughts keep returning to OOP, should I / shouldn’t I. I thought I'd take another look.
In the following code I've setup a Main Page with a PageFrame.
What I am trying to do is add a label to each PageFrame, lblTest1 to Page1 , lblTest2 to Page2 etc but can’t seem to find where to put the code or find the correct syntax.
Regards,
David
Recreational Developer and End User of VFP for my personal use in 'Amateur Radio' and 'British Railways' related Applications.
As my thoughts keep returning to OOP, should I / shouldn’t I. I thought I'd take another look.
In the following code I've setup a Main Page with a PageFrame.
What I am trying to do is add a label to each PageFrame, lblTest1 to Page1 , lblTest2 to Page2 etc but can’t seem to find where to put the code or find the correct syntax.
Code:
CLEAR
Local oForm
oForm = CREATEOBJECT("clsMainForm")
oForm.SHOW()
Read EVENTS
CLOSE ALL
CLEAR ALL
RETURN
*
* Define Main Form
*
Define CLASS clsMainForm AS FORM
WindowState = 0
WindowType = 0
Caption = "Amateur Radio Logging Program"
Height = 978
Width = 1680
Themes = .F.
Add OBJECT cmdExit AS COMMANDBUTTON WITH;
Caption = "Exit Program", FontSize = 24, FontBold = .T., Backcolor = RGB(192,192,192), ForeColor = RGB(255,0,0), ;
LEFT = 1390, Top = 800, Width = 300, Height = 60, Alignment = 2
*
* Exit Program
*
Procedure cmdExit.CLICK
thisform.Release
ENDPROC
*
* Add Pageframe to Form
*
Add OBJECT pfMain AS clsMainPageFrame WITH;
PAGECOUNT = 6, ;
LEFT = 0, ;
TOP = 0, ;
WIDTH = THIS.WIDTH - 10, ;
HEIGHT = THIS.HEIGHT - 300
ADD OBJECT lblTest1 as Label WITH Left = 0, Top = 40, width = 1668, Height = 46, Alignment = 2, ;
Backcolor = RGB(255,255,128), Caption = "Page 1", FontSize = 24, FontName = "Verdana", BorderStyle = 1
ADD OBJECT lblTest2 as Label WITH Left = 0, Top = 140, width = 1668, Height = 46, Alignment = 2, ;
Backcolor = RGB(255,255,128), Caption = "Page 2", FontSize = 24, FontName = "Verdana", BorderStyle = 1
ADD OBJECT lblTest3 as Label WITH Left = 0, Top = 240, width = 1668, Height = 46, Alignment = 2, ;
Backcolor = RGB(255,255,128), Caption = "Page 3", FontSize = 24, FontName = "Verdana", BorderStyle = 1
ADD OBJECT lblTest4 as Label WITH Left = 0, Top = 340, width = 1668, Height = 46, Alignment = 2, ;
Backcolor = RGB(255,255,128), Caption = "Page 4", FontSize = 24, FontName = "Verdana", BorderStyle = 1
ADD OBJECT lblTest5 as Label WITH Left = 0, Top = 440, width = 1668, Height = 46, Alignment = 2, ;
Backcolor = RGB(255,255,128), Caption = "Page 5", FontSize = 24, FontName = "Verdana", BorderStyle = 1
ADD OBJECT lblTest6 as Label WITH Left = 0, Top = 540, width = 1668, Height = 46, Alignment = 2, ;
Backcolor = RGB(255,255,128), Caption = "Page 6", FontSize = 24, FontName = "Verdana", BorderStyle = 1
* ADD OBJECT pfHeader as Container WITH;
Left = 0, Top = 100, width = 1668, Height = 46, Backcolor = RGB(255,255,128)
Enddefine
*
* Define Main Pageframe
*
Define CLASS clsMainPageFrame AS PAGEFRAME
PageCount = 6
page1.Caption = "WAB Awards"
page1.FontBold = .T.
page1.FontName = "Arial"
page1.FontSize = 14
page1.ForeColor = RGB(0,0,255)
page2.Caption = "Logbook"
page2.FontBold = .T.
page2.fontname = "Arial"
page2.fontsize = 14
page2.ForeColor = RGB(0,0,0)
page3.Caption = "WAB Net"
page3.FontBold = .T.
page3.fontname = "Arial"
page3.fontsize = 14
page3.ForeColor = RGB(0,0,255)
page4.Caption = "Small Squares"
page4.FontBold = .T.
page4.fontname = "Arial"
page4.fontsize = 14
page4.ForeColor = RGB(128,64,64)
page5.Caption = "Large Squares"
page5.FontBold = .T.
page5.fontname = "Arial"
page5.fontsize = 14
page5.ForeColor = RGB(0,128,0)
page6.Caption = "WAB Book Numbers"
page6.FontBold = .T.
page6.fontname = "Arial"
page6.fontsize = 14
page6.ForeColor = RGB(255,128,0)
ENDDEFINE
Regards,
David
Recreational Developer and End User of VFP for my personal use in 'Amateur Radio' and 'British Railways' related Applications.