nastasa eodor wrote:Xusinboy Bekchanov wrote:nastasa eodor wrote:the new one
https://drive.google.com/file/d/1thgscO ... sp=sharing
pay attention become more complex...but you will deal it.
Good work.
thanks pleae look on my new wrapper...
Ok
nastasa eodor wrote:Xusinboy Bekchanov wrote:nastasa eodor wrote:the new one
https://drive.google.com/file/d/1thgscO ... sp=sharing
pay attention become more complex...but you will deal it.
Good work.
thanks pleae look on my new wrapper...
nimdays wrote:No example?
Code: Select all
'***************************************************************
#Include Once "GUIS.1.0.bi"
type CFORM1 extends CFORM
Private:
Dim As StatusbarPanel Panel1,Panel2,Panel3,Panel4,Panel5,Panel6,Panel7
Declare Sub StatusbarLoad()
Declare Sub Form_MouseMove(ByRef sender As object,Button As Integer, Shift As Integer,X As Integer, Y As Integer)
Declare Static Sub Command1_MouseMove(ByRef sender As object,Button As Integer,Shift As Integer, X As Integer,Y As Integer)
Declare Static Sub Command1_Click(ByRef sender As object)
Declare Static Sub sbrSample_PanelClick(ByRef sender As object,ByRef Panel As StatusbarPanel, ByVal Button As MouseButtonConstants)
Public:
Frame1 As CGroupBox
Option2 AS CRadioButton
Option1 AS CRadioButton
sbrSample AS CStatusBar
Command1(1 to 3) AS CButton
DECLARE Static SUB Option2_Click(byref sender as OBJECT)
DECLARE Static SUB Option1_Click(byref sender as OBJECT)
Declare Sub Form_Create(byref sender as OBJECT)
Declare Sub Form_MouseDown(byref sender as OBJECT,Button As Integer,Shift As Integer,X As Integer,Y As Integer)
Declare Sub Form_KeyPress(ByRef sender As OBject,byref nKey AS Integer,lKeyStatus As Integer)
Declare Sub Form_Close(byref sender as OBJECT,ByRef action As Integer)
Declare Sub Form_Resize(byref sender as OBJECT)
DECLARE SUB FormLoad()
Declare constructor()
Declare Destructor()
End type
DIM SHARED Form1 AS CFORM1
'***************************************************************
' Now let's create and load the form and all of its controls
'***************************************************************
SUB CFORM1.FormLoad()
this.create( "Form1",271,173,472,452 + 15)
this.Startup=CTRUE ' Change this to 0 if not the main Form
StatusbarLoad()
Frame1.create(Cast(CFORM,Form1),"Style",312,16,137,105)
Option2.create(@Frame1,"Simple",16,60,85,29)
Option2.caption="Simple"
Option1.create(@Frame1,"Normal",16,24,101,25)
Option1.caption="Normal"
Command1(1).create( Cast(CFORM,Form1),"Reports",12,20,185,45)
Command1(1).tag=1
Command1(2).create(Cast(CFORM,Form1),"Utilities",12,98,185,45)
Command1(2).tag=2
Command1(3).create(Cast(CFORM,Form1),"Exit",12,176,185,45)
Command1(3).caption="Exit"
Command1(3).tag=3
For i As Integer=1 To 3
Command1(i).onMouseMove=@Command1_MouseMove
Command1(i).onClick=@Command1_Click
Next i
' set controls callback
Option2.OnClick=@Option2_Click
Option1.OnClick=@Option1_Click
sbrSample.OnPanelClick=@sbrSample_PanelClick
this.Show ' Affiche la Form
END SUB
Sub CFORM1.StatusBarLoad()
sbrSample.Create( cast(CFORM,Form1),"",0,412,467,25)
'Dim As StatusbarPanel Panel1,Panel2,Panel3,Panel4,Panel5,Panel6,Panel7
With Panel1
' .AutoSize = StatusBarPanelStyleSpring
.Width = 261' 3916/15
.Text = "Sample Text"
.Text = "Sample Text"
.Key = "MainText"
End With
With Panel2
.Style = StatusBarPanelStyleCaps
.Alignment = StatusBarPanelAlignmentCenter
.Enabled = 0 'False
.Width = 70
.MinWidth = 70
.Text = "CAPS"
.Key = "CapsLock"
End With
With Panel3
.Style = StatusBarPanelStyleNum
.Alignment = StatusBarPanelAlignmentCenter
.Enabled = 0 'False
.Width = 70
.MinWidth = 70
.Text = "NUM"
.Key = "NumLock"
End With
With Panel4
.Style = StatusBarPanelStyleIns
.Alignment = StatusBarPanelAlignmentCenter
.Enabled = 0 'False
.Width = 70
.MinWidth = 70
.Text = "INS"
.Key = "InsertMode"
End With
With Panel5
.Style = StatusBarPanelStyleScrl
.Alignment = StatusBarPanelAlignmentCenter
.Enabled = 0 'False
.Width = 83
.MinWidth = 83
.Text = "SCRL"
.Key = "ScrollLock"
End With
With Panel6
.Style = StatusBarPanelStyleTime
.Alignment = StatusBarPanelAlignmentCenter
.AutoSize = StatusBarPanelAutoSizeContent
.Width = 106 '1588/15
.MinWidth = 106
.Text = "8:27 AM"
.Key = "Time"
End With
With Panel7
.Style = StatusBarPanelStyleDate
.Alignment = StatusBarPanelAlignmentCenter
.AutoSize = StatusBarPanelAutoSizeContent
.Width = 118
.MinWidth = 118
.Text = "1/13/2005"
.Key = "Date"
End With
sbrSample.Panels.Add Panel1
sbrSample.Panels.Add Panel2
sbrSample.Panels.Add Panel3
sbrSample.Panels.Add Panel4
sbrSample.Panels.Add Panel5
sbrSample.Panels.Add Panel6
sbrSample.Panels.Add Panel7
End Sub
'***********************************************************************************
' Add any other supporting routines here
'***********************************************************************************
Sub CFORM1.Form_Create(byref sender as OBJECT)
' Add Your Code hear
End Sub
Sub CFORM1.Form_MouseDown(byref sender as OBJECT,Button As Integer,Shift As Integer,X As Integer,Y As Integer)
End Sub
Sub CFORM1.Form_KeyPress(ByRef sender As OBject,byref nKey AS Integer,lKeyStatus As Integer)
' Add Your Code hear
End Sub
Sub CFORM1.Form_Close(byref sender as OBJECT,ByRef action As Integer)
action=1
End Sub
Sub CFORM1.Form_Resize(byref sender as OBJECT)
Form1.sbrSample.autosize
End Sub
Constructor CFORM1
FormLoad()
' Add Your Code hear
End Constructor
Destructor CFORM1
' Add Your Code hear
End Destructor
SUB CFORM1.Option2_Click(ByRef sender As OBJECT)
FORM1.sbrSample.Style = StatusBarStyleSimple
FORM1.sbrSample.SimpleText = "Processing ... Please Wait."
FORM1.sbrSample.Refresh ' bug
END SUB
SUB CFORM1.Option1_Click(ByRef sender As OBJECT)
FORM1.sbrSample.Style = StatusBarStyleNormal
FORM1.sbrSample.Refresh ' bug
END SUB
Private Sub CFORM1.Form_MouseMove(ByRef sender As object,Button As Integer, Shift As Integer, X As Integer,Y As Integer)
sbrSample.Panels["MainText"].Text = "Ready."
End Sub
Private Sub CFORM1.Command1_MouseMove(ByRef sender As object,Button As Integer,Shift As Integer, X As Integer, Y As Integer)
Select Case *Cast(Cbutton Ptr,@sender).tag
Case 1
FORM1.sbrSample.Panels["MainText"].Text = "Print a report"
Case 2
FORM1.sbrSample.Panels["MainText"].Text = "Perform database utilities"
Case Else
FORM1.sbrSample.Panels["MainText"].Text = "Exit this program"
End Select
End Sub
Private Sub CFORM1.Command1_Click(ByRef sender As object)
Select Case *Cast(Cbutton Ptr,@sender).tag
case 1
Dim As CControlList c=FORM1.GetControls
App.msgbox " childs count : " & c.count
c.Clear
Exit Select
Case 2
Case 3
App.Destroy ' est mieux que End
End Select
End Sub
Private Sub CFORM1.sbrSample_PanelClick(ByRef sender As object,ByRef Panel As StatusbarPanel, ByVal Button As MouseButtonConstants)
If panel Then
App.MsgBox "Panel Index: " & Panel.Index & vbNewLine & "Panel Key: " & Panel.Key
EndIf
End Sub
Form1.show()
App.Run
App.Destroy
'***********************************************************************************
' End of program
'***********************************************************************************
aloberoger wrote:I think we need a little discussion to choose a method of easy and common programming that would allow us to evolve in open source as you said. you need a flat form for that.
For example, look at the result of this way of programming
Form_MouseDown is not static but virtual in baseCode: Select all
'***************************************************************
#Include Once "GUIS.1.0.bi"
type CFORM1 extends CFORM
Private:
Dim As StatusbarPanel Panel1,Panel2,Panel3,Panel4,Panel5,Panel6,Panel7
Declare Sub StatusbarLoad()
Declare Sub Form_MouseMove(ByRef sender As object,Button As Integer, Shift As Integer,X As Integer, Y As Integer)
Declare Static Sub Command1_MouseMove(ByRef sender As object,Button As Integer,Shift As Integer, X As Integer,Y As Integer)
Declare Static Sub Command1_Click(ByRef sender As object)
Declare Static Sub sbrSample_PanelClick(ByRef sender As object,ByRef Panel As StatusbarPanel, ByVal Button As MouseButtonConstants)
Public:
Frame1 As CGroupBox
Option2 AS CRadioButton
Option1 AS CRadioButton
sbrSample AS CStatusBar
Command1(1 to 3) AS CButton
DECLARE Static SUB Option2_Click(byref sender as OBJECT)
DECLARE Static SUB Option1_Click(byref sender as OBJECT)
Declare Sub Form_Create(byref sender as OBJECT)
Declare Sub Form_MouseDown(byref sender as OBJECT,Button As Integer,Shift As Integer,X As Integer,Y As Integer)
Declare Sub Form_KeyPress(ByRef sender As OBject,byref nKey AS Integer,lKeyStatus As Integer)
Declare Sub Form_Close(byref sender as OBJECT,ByRef action As Integer)
Declare Sub Form_Resize(byref sender as OBJECT)
DECLARE SUB FormLoad()
Declare constructor()
Declare Destructor()
End type
DIM SHARED Form1 AS CFORM1
'***************************************************************
' Now let's create and load the form and all of its controls
'***************************************************************
SUB CFORM1.FormLoad()
this.create( "Form1",271,173,472,452 + 15)
this.Startup=CTRUE ' Change this to 0 if not the main Form
StatusbarLoad()
Frame1.create(Cast(CFORM,Form1),"Style",312,16,137,105)
Option2.create(@Frame1,"Simple",16,60,85,29)
Option2.caption="Simple"
Option1.create(@Frame1,"Normal",16,24,101,25)
Option1.caption="Normal"
Command1(1).create( Cast(CFORM,Form1),"Reports",12,20,185,45)
Command1(1).tag=1
Command1(2).create(Cast(CFORM,Form1),"Utilities",12,98,185,45)
Command1(2).tag=2
Command1(3).create(Cast(CFORM,Form1),"Exit",12,176,185,45)
Command1(3).caption="Exit"
Command1(3).tag=3
For i As Integer=1 To 3
Command1(i).onMouseMove=@Command1_MouseMove
Command1(i).onClick=@Command1_Click
Next i
' set controls callback
Option2.OnClick=@Option2_Click
Option1.OnClick=@Option1_Click
sbrSample.OnPanelClick=@sbrSample_PanelClick
this.Show ' Affiche la Form
END SUB
Sub CFORM1.StatusBarLoad()
sbrSample.Create( cast(CFORM,Form1),"",0,412,467,25)
'Dim As StatusbarPanel Panel1,Panel2,Panel3,Panel4,Panel5,Panel6,Panel7
With Panel1
' .AutoSize = StatusBarPanelStyleSpring
.Width = 261' 3916/15
.Text = "Sample Text"
.Text = "Sample Text"
.Key = "MainText"
End With
With Panel2
.Style = StatusBarPanelStyleCaps
.Alignment = StatusBarPanelAlignmentCenter
.Enabled = 0 'False
.Width = 70
.MinWidth = 70
.Text = "CAPS"
.Key = "CapsLock"
End With
With Panel3
.Style = StatusBarPanelStyleNum
.Alignment = StatusBarPanelAlignmentCenter
.Enabled = 0 'False
.Width = 70
.MinWidth = 70
.Text = "NUM"
.Key = "NumLock"
End With
With Panel4
.Style = StatusBarPanelStyleIns
.Alignment = StatusBarPanelAlignmentCenter
.Enabled = 0 'False
.Width = 70
.MinWidth = 70
.Text = "INS"
.Key = "InsertMode"
End With
With Panel5
.Style = StatusBarPanelStyleScrl
.Alignment = StatusBarPanelAlignmentCenter
.Enabled = 0 'False
.Width = 83
.MinWidth = 83
.Text = "SCRL"
.Key = "ScrollLock"
End With
With Panel6
.Style = StatusBarPanelStyleTime
.Alignment = StatusBarPanelAlignmentCenter
.AutoSize = StatusBarPanelAutoSizeContent
.Width = 106 '1588/15
.MinWidth = 106
.Text = "8:27 AM"
.Key = "Time"
End With
With Panel7
.Style = StatusBarPanelStyleDate
.Alignment = StatusBarPanelAlignmentCenter
.AutoSize = StatusBarPanelAutoSizeContent
.Width = 118
.MinWidth = 118
.Text = "1/13/2005"
.Key = "Date"
End With
sbrSample.Panels.Add Panel1
sbrSample.Panels.Add Panel2
sbrSample.Panels.Add Panel3
sbrSample.Panels.Add Panel4
sbrSample.Panels.Add Panel5
sbrSample.Panels.Add Panel6
sbrSample.Panels.Add Panel7
End Sub
'***********************************************************************************
' Add any other supporting routines here
'***********************************************************************************
Sub CFORM1.Form_Create(byref sender as OBJECT)
' Add Your Code hear
End Sub
Sub CFORM1.Form_MouseDown(byref sender as OBJECT,Button As Integer,Shift As Integer,X As Integer,Y As Integer)
End Sub
Sub CFORM1.Form_KeyPress(ByRef sender As OBject,byref nKey AS Integer,lKeyStatus As Integer)
' Add Your Code hear
End Sub
Sub CFORM1.Form_Close(byref sender as OBJECT,ByRef action As Integer)
action=1
End Sub
Sub CFORM1.Form_Resize(byref sender as OBJECT)
Form1.sbrSample.autosize
End Sub
Constructor CFORM1
FormLoad()
' Add Your Code hear
End Constructor
Destructor CFORM1
' Add Your Code hear
End Destructor
SUB CFORM1.Option2_Click(ByRef sender As OBJECT)
FORM1.sbrSample.Style = StatusBarStyleSimple
FORM1.sbrSample.SimpleText = "Processing ... Please Wait."
FORM1.sbrSample.Refresh ' bug
END SUB
SUB CFORM1.Option1_Click(ByRef sender As OBJECT)
FORM1.sbrSample.Style = StatusBarStyleNormal
FORM1.sbrSample.Refresh ' bug
END SUB
Private Sub CFORM1.Form_MouseMove(ByRef sender As object,Button As Integer, Shift As Integer, X As Integer,Y As Integer)
sbrSample.Panels["MainText"].Text = "Ready."
End Sub
Private Sub CFORM1.Command1_MouseMove(ByRef sender As object,Button As Integer,Shift As Integer, X As Integer, Y As Integer)
Select Case *Cast(Cbutton Ptr,@sender).tag
Case 1
FORM1.sbrSample.Panels["MainText"].Text = "Print a report"
Case 2
FORM1.sbrSample.Panels["MainText"].Text = "Perform database utilities"
Case Else
FORM1.sbrSample.Panels["MainText"].Text = "Exit this program"
End Select
End Sub
Private Sub CFORM1.Command1_Click(ByRef sender As object)
Select Case *Cast(Cbutton Ptr,@sender).tag
case 1
Dim As CControlList c=FORM1.GetControls
App.msgbox " childs count : " & c.count
c.Clear
Exit Select
Case 2
Case 3
App.Destroy ' est mieux que End
End Select
End Sub
Private Sub CFORM1.sbrSample_PanelClick(ByRef sender As object,ByRef Panel As StatusbarPanel, ByVal Button As MouseButtonConstants)
If panel Then
App.MsgBox "Panel Index: " & Panel.Index & vbNewLine & "Panel Key: " & Panel.Key
EndIf
End Sub
Form1.show()
App.Run
App.Destroy
'***********************************************************************************
' End of program
'***********************************************************************************
Code: Select all
#Include Once "GUIS.1.0.bi"
Type CForm1 extends CFORm
BUTTON1 As CButton
BUTTON2 As CButton
Edit1 As CMemo
statusbar1 As Cstatusbar
Declare Sub FormReSize(ByRef sender As OBJECT)
Declare Constructor()
Declare Destructor()
Private:
Declare Static Sub Button1_Click(ByRef sender As OBJECT)
Declare Static Sub Button2_click(ByRef sender As OBJECT)
End Type
Type CForm2 extends CFORm
BUTTON1 As CButton
BUTTON2 As CButton
Edit1 As CMemo
Declare Constructor()
Declare Destructor()
Declare Sub show()
Declare Sub FormWrite(ByRef f As Cform)
Private:
Declare Static sub Button1_Click(ByRef sender As OBJECT)
Declare Static sub Button2_Click(ByRef sender As OBJECT)
End Type
Dim Shared Form1 As Cform1
Dim Shared Form2 As Cform2
Dim Shared level As Integer
Const Indent3 = " "
Const Indent2 = " "
Function EnumCtrls(ByRef c As Const cControl,ByRef level As Integer) As String
Dim ss As String,oldlevel As Integer
level+=3 : oldlevel=level
Dim ByRef As CControl ff = *Cast(CControl Ptr,@c)
For i As Integer=0 To ff.controls.count-1
ss &= Space(level) & "Begin FBGUIS." & ff.controls[i].typeName & Space(2) & ff.controls[i].name & vbcrlf
ss &= Space(level) & Indent3 & "left = " & ff.controls[i].left & vbcrlf
ss &= Space(level) & Indent3 & "top = " & ff.controls[i].top & vbcrlf
ss &= Space(level) & Indent3 & "width = " & ff.controls[i].width & vbcrlf
ss &= Space(level) & Indent3 & "height = " & ff.controls[i].height & vbcrlf
If Not(ff.controls[i] Is CMemo) Then
ss &= Space(level) & Indent3 & "caption = " & Chr(34) & Trim(ff.controls[i].caption) & Chr(34) & vbcrlf ' bug
EndIf
ss &= Space(level) & Indent3 & "Color = " & ff.controls[i].Color & vbcrlf
If ff.MousePointer <> 0 Then
ss &= Space(level) & Indent3 & "MousePointer = " & ff.controls[i].MousePointer & vbcrlf
EndIf
If ff.controls[i].Visible =FALSE Then
ss &= Space(level) & Indent3 & "Visible = " & ff.controls[i].Visible & vbcrlf
EndIf
If ff.controls[i].TextColor <> 0 Then
ss &= Space(level) & Indent3 & "TextColor = " & ff.controls[i].TextColor & vbcrlf
EndIf
If Len(ff.controls[i].ToolTipText) Then
ss &= Space(level) & Indent3 & "ToolTipText = " & Chr(34) & Trim(ff.controls[i].ToolTipText) & Chr(34) & vbcrlf
EndIf
If (ff.controls[i] Is CHScrollBar) then
ss &= Space(level) & Indent3 & "Value = " & *Cast(CHScrollBar Ptr,@ff.controls[i]).Value & vbcrlf
ss &= Space(level) & Indent3 & "MaxValue = " & *Cast(CHScrollBar Ptr,@ff.controls[i]).MaxValue & vbcrlf
ss &= Space(level) & Indent3 & "MinValue = " & *Cast(CHScrollBar Ptr,@ff.controls[i]).MinValue & vbcrlf
ss &= Space(level) & Indent3 & "LargeChange = " & *Cast(CHScrollBar Ptr,@ff.controls[i]).LargeChange & vbcrlf
ss &= Space(level) & Indent3 & "SmallChange = " & *Cast(CHScrollBar Ptr,@ff.controls[i]).SmallChange & vbcrlf
EndIf
If (ff.controls[i] Is CVScrollBar) then
ss &= Space(level) & Indent3 & "Value = " & *Cast(CVScrollBar Ptr,@ff.controls[i]).Value & vbcrlf
ss &= Space(level) & Indent3 & "MaxValue = " & *Cast(CVScrollBar Ptr,@ff.controls[i]).MaxValue & vbcrlf
ss &= Space(level) & Indent3 & "MinValue = " & *Cast(CVScrollBar Ptr,@ff.controls[i]).MinValue & vbcrlf
ss &= Space(level) & Indent3 & "LargeChange = " & *Cast(CVScrollBar Ptr,@ff.controls[i]).LargeChange & vbcrlf
ss &= Space(level) & Indent3 & "SmallChange = " & *Cast(CVScrollBar Ptr,@ff.controls[i]).SmallChange & vbcrlf
EndIf
'ss &= Space(level) & Indent3 & "MultiLine = " & ff.controls[i].MultiLine & vbcrlf
'ss &= Space(level) & Indent3 & "ScrollBars = " & ff.controls[i].ScrollBars & vbcrlf
If (ff.controls[i] Is CCheckBox) Then
ss &= Space(level) & Indent3 & "Checked = " & *Cast(CCheckBox Ptr,@ff.controls[i]).Checked & vbcrlf
EndIf
If (ff.controls[i] Is CRadioButton) Then
ss &= Space(level) & Indent3 & "Checked = " & *Cast(CRadioButton Ptr,@ff.controls[i]).Checked & vbcrlf
EndIf
If (ff.controls[i].Font.size<> 7) Or (Trim(ff.controls[i].Font.Name) <> "Tahoma") Or (ff.controls[i].Font.Bold<>FALSE) Or (ff.controls[i].Font.Italic<>FALSE) Or (ff.controls[i].Font.Underline<>FALSE) Or (ff.controls[i].Font.Charset<>FALSE) Then
ss &= Space(level) & Indent2 & "BeginProperty Font" & vbcrlf
ss &= Space(level) & Indent3 & "Name = " & Chr(34) & Trim(ff.controls[i].Font.Name) & Chr(34) & vbcrlf
ss &= Space(level) & Indent3 & "Size = " & ff.controls[i].Font.size & vbcrlf
ss &= Space(level) & Indent3 & "Charset = " & ff.controls[i].Font.Charset & vbcrlf
ss &= Space(level) & Indent3 & "Bold = " & ff.controls[i].Font.Bold & vbcrlf
ss &= Space(level) & Indent3 & "Underline = " & ff.controls[i].Font.Underline & vbcrlf
ss &= Space(level) & Indent3 & "Italic = " & ff.controls[i].Font.Italic & vbcrlf
ss &= Space(level) & Indent3 & "Strikethrough = " & ff.controls[i].Font.Strikethrough & vbcrlf
ss &= Space(level) & Indent2 & "EndProperty" & vbcrlf
EndIf
If ff.controls[i].controls.count Then
level+=3
ss &= EnumCtrls(ff.controls[i],level)
EndIf
ss &= Space(oldlevel) & "End" & vbcrlf
Next i
Return ss
End Function
Function EnumCtrlsFrm(ByRef f As Const Cform,ByRef level As Integer) As String
Dim ss As String,oldlevel As Integer,frm As Cform=Cast(Cform,f)
level+=3 : oldlevel=level
ss &= Space(level) & "Begin FBGUIS." & frm.typeName & Space(2) & frm.name & vbcrlf
ss &= Space(level) & Indent3 & "left = " & frm.left & vbcrlf
ss &= Space(level) & Indent3 & "top = " & frm.top & vbcrlf
ss &= Space(level) & Indent3 & "width = " & frm.width & vbcrlf
ss &= Space(level) & Indent3 & "height = " & frm.Height & vbcrlf
ss &= Space(level) & Indent3 & "caption = " & Chr(34) & Trim(frm.caption) & Chr(34) & vbcrlf
ss &= Space(level) & Indent3 & "Color = " & Cast(Cform,f).Color & vbcrlf
If frm.MousePointer <> 0 Then
ss &= Space(level) & Indent3 & "MousePointer = " & frm.MousePointer & vbcrlf
EndIf
If frm.TextColor <> 0 Then
ss &= Space(level) & Indent3 & "TextColor = " & frm.TextColor & vbcrlf
EndIf
If Len(frm.ToolTipText) Then
ss &= Space(level) & Indent3 & "ToolTipText = " & Chr(34) & Trim(frm.ToolTipText) & Chr(34) & vbcrlf
EndIf
If (frm.Font.size<> 7) Or (Trim(frm.Font.Name) <> "Tahoma") Or (frm.Font.Bold<>FALSE) Or (frm.Font.Italic<>FALSE) Or (frm.Font.Underline<>FALSE) Or (frm.Font.Charset<>FALSE) Then
ss &= Space(level) & Indent2 & "BeginProperty Font" & vbcrlf
ss &= Space(level) & Indent3 & "Name = " & Chr(34) & Trim(frm.Font.Name) & Chr(34) & vbcrlf
ss &= Space(level) & Indent3 & "Size = " & frm.Font.size & vbcrlf
ss &= Space(level) & Indent3 & "Charset = " & frm.Font.Charset & vbcrlf
ss &= Space(level) & Indent3 & "Bold = " & frm.Font.Bold & vbcrlf
ss &= Space(level) & Indent3 & "Underline = " & frm.Font.Underline & vbcrlf
ss &= Space(level) & Indent3 & "Italic = " & frm.Font.Italic & vbcrlf
ss &= Space(level) & Indent3 & "Strikethrough = " & frm.Font.Strikethrough & vbcrlf
ss &= Space(level) & Indent2 & "EndProperty" & vbcrlf
EndIf
If frm.controls.count Then
level+=3
ss &=EnumCtrls(f,level)
EndIf
ss &= Space(oldlevel) & "End" & vbcrlf
Return ss
End Function
Constructor CForm1()
this.create("form main",0,0,640,532)
this.caption="Form" & App.formcount
this.name= "Form1"
this.Startup=CTRUE
this.Color= rgbTomato 'rgbYellow
'Edit1.winStyle=WS_CHILD OR WS_VISIBLE OR WS_CLIPSIBLINGS OR ES_MULTILINE Or ES_AUTOVSCROLL
Edit1.Create(@This," ",10,10,522,400)
'Edit1.AutoHScroll=1
'Edit1.AutoVScroll=1
'Edit1.HScroll=1
'Edit1.VScroll=1
button1.Create(@This,"&Show Form2",21,420,120,32)
button1.OnClick=@Button1_Click
button1.Font.name="Times new Roman"
button1.Font.size=12
button1.Font.Bold=CTRUE
button2.Create(@This,"Iterator",210,420,120,32)
button2.OnClick=@Button2_Click
statusbar1.create(@This,0,0,0,0)
statusbar1.Panels.Add("Panel1","Panel1",100,StatusBarPanelStyleText) ' le dernier parametre doit etre present pour eviter toute ambiguite
statusbar1.Panels.Add("Panel2","Panel2",250,StatusBarPanelStyleText)
statusbar1.Panels.Add("Panel3","Panel3",120,StatusBarPanelStyleText)
Statusbar1.Panels[1].ToolTipText="mon tips sur status panel"
End Constructor
Destructor CForm1()
'base.destructor() bug
End Destructor
Sub CForm1.FormReSize(ByRef sender As OBJECT)
'Form1.Statusbar1.Panels[0].width=Form1.ClientWidth/3
'Form1.Statusbar1.Panels[1].width=Form1.ClientWidth/3
'Form1.Statusbar1.Panels[2].width=Form1.ClientWidth/3
Statusbar1.autoSize
End Sub
sub CForm1.Button1_Click(ByRef sender As OBJECT)
Form2.Show()
Form2.center(Form1.handle)
End Sub
sub CForm1.Button2_Click(ByRef sender As OBJECT)
Dim As String s ,ss
Dim As String t
Form1.Edit1.Clear
For i As Integer=0 To App.Forms.Count-1
Form1.Edit1.AddLine("")
Form1.Edit1.AddLine( "Form : " & i+1 )
Dim ByRef As CControl ppc =App.Forms[i]
Form1.Edit1.AddLine( "Controls count: " & ppc.Controls.Count )
For j As Integer=0 To ppc.Controls.Count-1
Dim byref As CControl ppc1 = ppc.Controls[j]
If ppc.Controls[j] Is CRadiobutton Then
t="RadioButton"
ElseIf ppc.Controls[j] Is CCheckBox Then
t="CheckBox"
Else
t=""
EndIf
Form1.Edit1.AddLine( "classname : " & ppc1.ClassName & " " & t )
Form1.Edit1.AddLine( "name : " & ppc1.Name )
Form1.Edit1.AddLine( "left : " & ppc1.Left & " top : " & ppc1.top )
Form1.Edit1.AddLine( "width : " & ppc1.Width & " Height : " & ppc1.Height )
Next j
Next
End Sub
'''' CFORM2 ''''''''''''''''''
Constructor CForm2()
End Constructor
Destructor CForm2()
End Destructor
Sub CForm2.show()
this.constructor() 'important
this.style=wsDialog
this.create("Form2",0,0,540,490)
this.Name="Form2"
this.Color= rgbYellow
'Edit1.winStyle=WS_VISIBLE Or WS_CHILD or WS_CLIPCHILDREN or WS_CLIPSIBLINGS or ES_NOHIDESEL or WS_HSCROLL or WS_VSCROLL or ES_MULTILINE Or ES_WANTRETURN
Edit1.Create(@this," ",10,10,522,400)
Edit1.Font=Cfont("Times new Roman",10,CTRUE)
Edit1.Name="Edit1"
button1.Create(@This,"OK",21,420,120,32)
button1.OnClick=@Button1_Click
button1.Font.name="Times new Roman"
button1.Font.size=15
button1.Font.Bold=CTRUE
button1.Name="button1"
button2.Create(@this,"Iterator",210,420,120,32)
button2.OnClick=@Button2_Click
button2.Name="button2"
base.show
End Sub
sub CForm2.Button1_Click(ByRef sender As OBJECT)
Dim ss As String,level As Integer
ss=EnumCtrlsFrm(Form2,level)
App.Msgbox ss 'Form2.Edit1.text
End Sub
sub CForm2.Button2_Click(ByRef sender As OBJECT)
Dim As String s ,ss
Dim As String t
Form2.Edit1.Clear
Form2.FormWrite(Form1)
Form2.FormWrite(Form2)
Return
For i As Integer=0 To App.Forms.Count-1
Form2.Edit1.AddLine("")
Form2.Edit1.AddLine( "Form : " & i+1 )
Dim ByRef As CControl ppc =App.Forms[i]
Form2.Edit1.AddLine( "Controls count: " & ppc.Controls.Count )
For j As Integer=0 To ppc.Controls.Count-1
Dim byref As CControl ppc1 = ppc.Controls[j]
If ppc.Controls[j] Is CRadiobutton Then
t="RadioButton"
ElseIf ppc.Controls[j] Is CCheckBox Then
t="CheckBox"
Else
t=""
EndIf
Form2.Edit1.AddLine( "classname : " & ppc1.ClassName & " " & t )
Form2.Edit1.AddLine( "name : " & ppc1.Name )
Form2.Edit1.AddLine( "left : " & ppc1.Left & " top : " & ppc1.top )
Form2.Edit1.AddLine( "width : " & ppc1.Width & " Height : " & ppc1.Height )
Next j
Next
End Sub
sub CForm2.FormWrite(ByRef f As Cform)
Dim As String s ,ss
Dim As String t
Dim As CControl ppc
Dim As CControl ppc1
Form2.Edit1.AddLine("")
Form2.Edit1.AddLine( "Form : " & f.name )
Form2.Edit1.AddLine( "Controls count: " & f.Controls.Count )
For j As Integer=0 To f.Controls.Count-1
'If (ppc.Controls[j]) Is CRadiobutton Then
' t="RadioButton"
'ElseIf (ppc.Controls[j]) Is CCheckBox Then
' t="CheckBox"
'Else
' t=""
'EndIf
If f.Controls[j].typeName="CRADIOBUTTON" Then
t="RadioButton"
ElseIf f.Controls[j].typeName= "CCHECKBOX" Then
t="CheckBox"
Else
t=""
EndIf
Form2.Edit1.AddLine( "classname : " & f.Controls[j].ClassName & " " & t )
Form2.Edit1.AddLine( "name : " & f.Controls[j].Name )
Form2.Edit1.AddLine( "left : " & f.Controls[j].Left & " top : " & f.Controls[j].top )
Form2.Edit1.AddLine( "width : " & f.Controls[j].Width & " Height : " & f.Controls[j].Height )
Form2.Edit1.AddLine( ".Font.size : " & f.Controls[j].Font.size )
Next j
' Next
End Sub
Sub Main
Form1.Center
Form1.Show()
Form1.Update()
App.Run
App.Destroy
End Sub
Main()
nastasa eodor wrote:its just a idea, please compile "gui.bas" it and you will see it in action...enjoy
nimdays wrote:nastasa eodor wrote:its just a idea, please compile "gui.bas" it and you will see it in action...enjoy
Sorry I missed that :)
Users browsing this forum: No registered users and 2 guests