Ortrun Erben
New Member
Ich habe lange in HB++ programmiert.
Wie konvertiere ich einen HB++ Quelltext in ein B4A - Programm?
Wie konvertiere ich einen HB++ Quelltext in ein B4A - Programm?
poste mal nen Stück Code (am besten mit Beschreibung,An alle: Weitere Meinungen?
poste mal nen Stück Code (am besten mit Beschreibung,
was er macht).
Private t2 As New Timer
Private o as Integer
Private t3 As New Timer
Private Konstante As Long
Private Sub t3_Timer()
ResetAutoOffTimer
End Sub
Private Sub t2_Timer()
field1.Text=field1.Text & "."
End Sub
Public Function AnAus() As String
t.Enabled=False
t2.Enabled=False
t.Enabled=True
t2.Enabled=True
End Function
Private Sub t_Timer()
Konstante = 60000
Select Case o
Case 1
Neu
'msgbox "Pause 600"
checkbox1.Text = "30 <-"
t.Enabled=False
t2.Enabled=False
t.Interval=30*Konstante
t2.Interval = t.Interval/60
t.Enabled=True
t2.Enabled=True
o = 2
Case 2
SystemSound(hbSoundAlarm)
checkbox1.Text = "30"
checkbox2.Text = "5 <-"
field1.Text = ""
checkbox1.Value=True
'msgbox "Drin"
'AnAus
t.Enabled=False
t2.Enabled=False
t.Interval=5*Konstante
t2.Interval = t.Interval/60
t.Enabled=True
t2.Enabled=True
o = 3
Case 3
SystemSound(hbSoundAlarm)
checkbox2.Text = "5"
checkbox3.Text = "30 <-"
field1.Text = ""
checkbox2.Value=True
picture2.Visible = True
'msgbox "Pause 600"
t.Enabled=False
t2.Enabled=False
t.Interval=30*Konstante
t2.Interval = t.Interval/60
t.Enabled=True
t2.Enabled=True
o = 4
Case 4
SystemSound(hbSoundAlarm)
checkbox4.Text = "5 <-"
checkbox3.Text = "30"
field1.Text = ""
checkbox3.Value=True
'msgbox "Pause 100"
t.Enabled=False
t2.Enabled=False
t.Interval=5*Konstante
t2.Interval = t.Interval/60
t.Enabled=True
t2.Enabled=True
o = 5
Case 5
SystemSound(hbSoundAlarm)
checkbox4.Text = "5"
checkbox5.Text = "30 <-"
field1.Text = ""
checkbox4.Value=True
picture2.Visible = False
picture3.Visible = True
'msgbox "Pause 600"
'AnAus
t.Enabled=False
t2.Enabled=False
t.Interval=30*Konstante
t2.Interval = t.Interval/60
t.Enabled=True
t2.Enabled=True
o = 6
Case 6
SystemSound(hbSoundAlarm)
checkbox6.Text = "5 <-"
checkbox5.Text = "30"
field1.Text = ""
checkbox5.Value=True
'msgbox "Pause 100"
t.Enabled=False
t2.Enabled=False
t.Interval=5*Konstante
t2.Interval = t.Interval/60
t.Enabled=True
t2.Enabled=True
o = 7
Case 7
SystemSound(hbSoundAlarm)
checkbox6.Text = "5"
checkbox7.Text = "30 <-"
field1.Text = ""
checkbox6.Value=True
picture3.Visible = False
picture4.Visible = True
'msgbox "Pause 600"
t.Enabled=False
t2.Enabled=False
t.Interval=30*Konstante
t2.Interval = t.Interval/60
t.Enabled=True
t2.Enabled=True
o = 8
Case 8
SystemSound(hbSoundAlarm)
checkbox8.Text = "2h <-"
checkbox7.Text = "30"
field1.Text = ""
checkbox7.Value=True
SystemSound(hbSoundAlarm)
'msgbox "Pause 600"
t.Enabled=False
t2.Enabled=False
t.Interval=120*Konstante
t2.Interval = t.Interval/60
t.Enabled=True
t2.Enabled=True
o = 9
Case 9
SystemSound(hbSoundAlarm)
checkbox8.Text = "2h"
field1.Text = ""
checkbox8.Value=True
o = 1
'msgbox "Warten auf Neu"
AnAus
t.Interval = 1
't2.Interval = t.Interval/60
t2.Enabled=false
btnBeginn.Text = "Beginn"
t.Enabled = False
Neu
End Select
End Sub
Private Sub btnBeginn_Click()
If btnBeginn.Text = "Beginn" Then
t3.Interval=1000
t3.Enabled=True
t2.Enabled=True
btnBeginn.Text = "Pause"
t.Enabled = True
Else
t3.Enabled=False
t2.Enabled=false
field1.Text=""
btnBeginn.Text = "Beginn"
t.Enabled = False
End If
End Sub
Private Sub frmZeitMain_Load()
o = 1
t.Enabled = False
t2.Enabled = False
End Sub
Private Sub btnNeustart_Click()
Dim r as HbMsgBoxReturn
r=MsgBox("Sicher?",hbMsgBoxConfirmation+hbMsgBoxYesNo)
If r=hbMsgBoxYes Then
t.Enabled = false
t2.Enabled = False
o = 1
btnBeginn.Text = "Beginn"
Neu
t.Interval = 5
End If
End Sub
Public Function Neu() As Integer
field1.Text=""
checkbox1.Value=False
checkbox2.Value=False
checkbox3.Value=False
checkbox4.Value=False
checkbox5.Value=False
checkbox6.Value=False
checkbox7.Value=False
checkbox8.Value=False
checkbox1.Text="30"
checkbox2.Text="5"
checkbox3.Text="30"
checkbox4.Text="5"
checkbox5.Text="30"
checkbox6.Text="5"
checkbox7.Text="30"
checkbox8.Text="2h"
picture2.Visible=False
picture3.Visible=False
picture4.Visible=False
End Function
<?xml version="1.0" encoding="utf-8"?>
<!-- Peter Holmes Consulting HB++ Form file -->
<Form Version="3.00">
<Name>frmZeitMain</Name>
<Segment>main</Segment>
<Locked>False</Locked>
<Layout Target="PalmOS">
<Left>0</Left>
<Top>0</Top>
<Width>160</Width>
<Height>160</Height>
<Caption xml:space="preserve">Zeiteinteilung</Caption>
<Modal>False</Modal>
<Help/>
<DIA>0</DIA>
<SaveBehind>True</SaveBehind>
<NavState>0</NavState>
<InitialFocus/>
<BottomLeft/>
<Picture>
<Name>Picture1</Name>
<Index>0</Index>
<Layer>0</Layer>
<Tag/>
<Left>0</Left>
<Top>13</Top>
<Anchors>0</Anchors>
<Visible>False</Visible>
<Image>Spirale</Image>
<NavFlags>0</NavFlags>
<NavOrder/>
<Above/>
<Below/>
</Picture>
<Button>
<Name>btnBeginn</Name>
<Index>0</Index>
<Layer>0</Layer>
<Tag/>
<Left>1</Left>
<Top>16</Top>
<Width>60</Width>
<Height>40</Height>
<Anchors>0</Anchors>
<Visible>True</Visible>
<Text xml:space="preserve">Beginn</Text>
<Font>Standard</Font>
<Frame>1</Frame>
<Repeating>False</Repeating>
<NavFlags>0</NavFlags>
<NavOrder/>
<Above/>
<Below/>
</Button>
<CheckBox>
<Name>CheckBox1</Name>
<Index>0</Index>
<Layer>0</Layer>
<Tag/>
<Left>68</Left>
<Top>19</Top>
<Width>66</Width>
<Height>12</Height>
<Anchors>0</Anchors>
<Visible>True</Visible>
<Text xml:space="preserve">30</Text>
<Font>Standard</Font>
<Value>False</Value>
<AnchorLeft>True</AnchorLeft>
<Group>0</Group>
<NavFlags>0</NavFlags>
<NavOrder/>
<Above/>
<Below/>
</CheckBox>
<CheckBox>
<Name>CheckBox2</Name>
<Index>0</Index>
<Layer>0</Layer>
<Tag/>
<Left>68</Left>
<Top>37</Top>
<Width>40</Width>
<Height>12</Height>
<Anchors>0</Anchors>
<Visible>True</Visible>
<Text xml:space="preserve">5</Text>
<Font>Standard</Font>
<Value>False</Value>
<AnchorLeft>True</AnchorLeft>
<Group>0</Group>
<NavFlags>0</NavFlags>
<NavOrder/>
<Above/>
<Below/>
</CheckBox>
<CheckBox>
<Name>CheckBox3</Name>
<Index>0</Index>
<Layer>0</Layer>
<Tag/>
<Left>68</Left>
<Top>55</Top>
<Width>40</Width>
<Height>12</Height>
<Anchors>0</Anchors>
<Visible>True</Visible>
<Text xml:space="preserve">30</Text>
<Font>Standard</Font>
<Value>False</Value>
<AnchorLeft>True</AnchorLeft>
<Group>0</Group>
<NavFlags>0</NavFlags>
<NavOrder/>
<Above/>
<Below/>
</CheckBox>
<CheckBox>
<Name>CheckBox4</Name>
<Index>0</Index>
<Layer>0</Layer>
<Tag/>
<Left>68</Left>
<Top>73</Top>
<Width>40</Width>
<Height>12</Height>
<Anchors>0</Anchors>
<Visible>True</Visible>
<Text xml:space="preserve">5</Text>
<Font>Standard</Font>
<Value>False</Value>
<AnchorLeft>True</AnchorLeft>
<Group>0</Group>
<NavFlags>0</NavFlags>
<NavOrder/>
<Above/>
<Below/>
</CheckBox>
<CheckBox>
<Name>CheckBox5</Name>
<Index>0</Index>
<Layer>0</Layer>
<Tag/>
<Left>68</Left>
<Top>92</Top>
<Width>40</Width>
<Height>12</Height>
<Anchors>0</Anchors>
<Visible>True</Visible>
<Text xml:space="preserve">30</Text>
<Font>Standard</Font>
<Value>False</Value>
<AnchorLeft>True</AnchorLeft>
<Group>0</Group>
<NavFlags>0</NavFlags>
<NavOrder/>
<Above/>
<Below/>
</CheckBox>
<CheckBox>
<Name>CheckBox6</Name>
<Index>0</Index>
<Layer>0</Layer>
<Tag/>
<Left>68</Left>
<Top>109</Top>
<Width>40</Width>
<Height>12</Height>
<Anchors>0</Anchors>
<Visible>True</Visible>
<Text xml:space="preserve">5</Text>
<Font>Standard</Font>
<Value>False</Value>
<AnchorLeft>True</AnchorLeft>
<Group>0</Group>
<NavFlags>0</NavFlags>
<NavOrder/>
<Above/>
<Below/>
</CheckBox>
<CheckBox>
<Name>CheckBox8</Name>
<Index>0</Index>
<Layer>0</Layer>
<Tag/>
<Left>68</Left>
<Top>145</Top>
<Width>40</Width>
<Height>12</Height>
<Anchors>0</Anchors>
<Visible>True</Visible>
<Text xml:space="preserve">2h</Text>
<Font>Standard</Font>
<Value>False</Value>
<AnchorLeft>True</AnchorLeft>
<Group>0</Group>
<NavFlags>0</NavFlags>
<NavOrder/>
<Above/>
<Below/>
</CheckBox>
<CheckBox>
<Name>CheckBox7</Name>
<Index>0</Index>
<Layer>0</Layer>
<Tag/>
<Left>68</Left>
<Top>127</Top>
<Width>40</Width>
<Height>12</Height>
<Anchors>0</Anchors>
<Visible>True</Visible>
<Text xml:space="preserve">30</Text>
<Font>Standard</Font>
<Value>False</Value>
<AnchorLeft>True</AnchorLeft>
<Group>0</Group>
<NavFlags>0</NavFlags>
<NavOrder/>
<Above/>
<Below/>
</CheckBox>
<Picture>
<Name>Picture2</Name>
<Index>0</Index>
<Layer>0</Layer>
<Tag/>
<Left>102</Left>
<Top>25</Top>
<Anchors>0</Anchors>
<Visible>False</Visible>
<Image>Einteilungen</Image>
<NavFlags>0</NavFlags>
<NavOrder/>
<Above/>
<Below/>
</Picture>
<Picture>
<Name>Picture3</Name>
<Index>0</Index>
<Layer>0</Layer>
<Tag/>
<Left>102</Left>
<Top>60</Top>
<Anchors>0</Anchors>
<Visible>False</Visible>
<Image>Zwei</Image>
<NavFlags>0</NavFlags>
<NavOrder/>
<Above/>
<Below/>
</Picture>
<Picture>
<Name>Picture4</Name>
<Index>0</Index>
<Layer>0</Layer>
<Tag/>
<Left>102</Left>
<Top>97</Top>
<Anchors>0</Anchors>
<Visible>False</Visible>
<Image>Drei</Image>
<NavFlags>0</NavFlags>
<NavOrder/>
<Above/>
<Below/>
</Picture>
<Field>
<Name>Field1</Name>
<Index>0</Index>
<Layer>0</Layer>
<Tag/>
<Left>3</Left>
<Top>109</Top>
<Width>59</Width>
<Height>52</Height>
<Anchors>0</Anchors>
<Visible>True</Visible>
<Font>LargeBold</Font>
<Underline>False</Underline>
<SingleLine>False</SingleLine>
<Align>0</Align>
<Editable>False</Editable>
<AutoShift>True</AutoShift>
<Numeric>False</Numeric>
<MaxChar>100</MaxChar>
<Scrollbar/>
<NavFlags>0</NavFlags>
<NavOrder/>
<Above/>
<Below/>
</Field>
<Graffiti>
<Name>Graffiti1</Name>
<Index>0</Index>
<Layer>0</Layer>
<Tag/>
<Left>148</Left>
<Top>147</Top>
<Anchors>0</Anchors>
</Graffiti>
<Button>
<Name>btnNeustart</Name>
<Index>0</Index>
<Layer>0</Layer>
<Tag/>
<Left>1</Left>
<Top>58</Top>
<Width>60</Width>
<Height>45</Height>
<Anchors>0</Anchors>
<Visible>True</Visible>
<Text xml:space="preserve">Neustart</Text>
<Font>Standard</Font>
<Frame>1</Frame>
<Repeating>False</Repeating>
<NavFlags>0</NavFlags>
<NavOrder/>
<Above/>
<Below/>
</Button>
</Layout>
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim o As Int
Dim Konstante As Int
Dim checkbox1 As CheckBox
Dim checkbox2 As CheckBox
Dim checkbox3 As CheckBox
Dim checkbox4 As CheckBox
Dim checkbox5 As CheckBox
Dim checkbox6 As CheckBox
Dim checkbox7 As CheckBox
Dim checkbox8 As CheckBox
Dim T1 As Timer
Dim T2 As Timer
Dim T3 As Timer
Dim b As Beeper
Dim Field1 As Label
Dim btnBeginn As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
checkbox1.Initialize("checkbox1")
checkbox2.Initialize("checkbox2")
checkbox3.Initialize("checkbox3")
checkbox4.Initialize("checkbox4")
checkbox5.Initialize("checkbox5")
checkbox6.Initialize("checkbox6")
checkbox7.Initialize("checkbox7")
checkbox8.Initialize("checkbox8")
Dim CheckBoxHeight As Int
Dim CheckBoxWidth As Int
CheckBoxWidth = 200dip
CheckBoxHeight = 40dip
Activity.AddView(checkbox1, 0, 0 , CheckBoxWidth, CheckBoxHeight)
Activity.AddView(checkbox2, 0, 80dip, CheckBoxWidth, CheckBoxHeight)
Activity.AddView(checkbox3, 0, 120dip, CheckBoxWidth, CheckBoxHeight)
Activity.AddView(checkbox4, 0, 160dip, CheckBoxWidth, CheckBoxHeight)
Activity.AddView(checkbox5, 0, 200dip, CheckBoxWidth, CheckBoxHeight)
Activity.AddView(checkbox6, 0, 240dip, CheckBoxWidth, CheckBoxHeight)
Activity.AddView(checkbox7, 0, 280dip, CheckBoxWidth, CheckBoxHeight)
Activity.AddView(checkbox8, 0, 320dip, CheckBoxWidth, CheckBoxHeight)
checkbox1.Text="30"
checkbox2.Text="5"
checkbox3.Text="30"
checkbox4.Text="5"
checkbox5.Text="30"
checkbox6.Text="5"
checkbox7.Text="30"
checkbox8.Text="2h"
T1.Initialize("T1", 1000)
T2.Initialize("T2", 1000)
T3.Initialize("T3", 1000)
b.Initialize(300, 500)
Field1.Initialize("Field1")
Activity.AddView(Field1, 0, 360dip, 200dip, 40dip)
btnBeginn.Initialize("btnBeginn")
btnBeginn.Text = "Beginn"
Activity.AddView(btnBeginn, 0, 400dip, 200dip, 40dip)
If FirstTime Then
o = 1
T1.Enabled = False
T2.Enabled = False
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub T1_Tick
Konstante = 60000
Select Case o
Case 1
Neu
'msgbox "Pause 600"
checkbox1.Text = "30 <-"
T1.Enabled=False
T2.Enabled=False
T1.Interval=30*Konstante
T2.Interval = T1.Interval/60
T1.Enabled=True
T2.Enabled=True
o = 2
Case 2
b.Beep
checkbox1.Text = "30"
checkbox2.Text = "5 <-"
Field1.Text = ""
checkbox1.Checked=True
'msgbox "Drin"
'AnAus
T1.Enabled=False
T2.Enabled=False
T1.Interval=5*Konstante
T2.Interval = T1.Interval/60
T1.Enabled=True
T2.Enabled=True
o = 3
Case 3
b.Beep
checkbox2.Text = "5"
checkbox3.Text = "30 <-"
Field1.Text = ""
checkbox2.Checked=True
'picture2.Visible = True
'msgbox "Pause 600"
T1.Enabled=False
T2.Enabled=False
T1.Interval=30*Konstante
T2.Interval = T1.Interval/60
T1.Enabled=True
T2.Enabled=True
o = 4
Case 4
b.Beep
checkbox4.Text = "5 <-"
checkbox3.Text = "30"
Field1.Text = ""
checkbox3.Checked=True
'msgbox "Pause 100"
T1.Enabled=False
T2.Enabled=False
T1.Interval=5*Konstante
T2.Interval = T1.Interval/60
T1.Enabled=True
T2.Enabled=True
o = 5
Case 5
b.Beep
checkbox4.Text = "5"
checkbox5.Text = "30 <-"
Field1.Text = ""
checkbox4.Checked=True
'picture2.Visible = False
'picture3.Visible = True
'msgbox "Pause 600"
'AnAus
T1.Enabled=False
T2.Enabled=False
T1.Interval=30*Konstante
T2.Interval = T1.Interval/60
T1.Enabled=True
T2.Enabled=True
o = 6
Case 6
b.Beep
checkbox6.Text = "5 <-"
checkbox5.Text = "30"
Field1.Text = ""
checkbox5.Checked=True
'msgbox "Pause 100"
T1.Enabled=False
T2.Enabled=False
T1.Interval=5*Konstante
T2.Interval = T1.Interval/60
T1.Enabled=True
T2.Enabled=True
o = 7
Case 7
b.Beep
checkbox6.Text = "5"
checkbox7.Text = "30 <-"
Field1.Text = ""
checkbox6.Checked=True
'picture3.Visible = False
'picture4.Visible = True
'msgbox "Pause 600"
T1.Enabled=False
T2.Enabled=False
T1.Interval=30*Konstante
T2.Interval = T1.Interval/60
T1.Enabled=True
T2.Enabled=True
o = 8
Case 8
b.Beep
checkbox8.Text = "2h <-"
checkbox7.Text = "30"
Field1.Text = ""
checkbox7.Checked=True
b.Beep
'msgbox "Pause 600"
T1.Enabled=False
T2.Enabled=False
T1.Interval=120*Konstante
T2.Interval = T1.Interval/60
T1.Enabled=True
T2.Enabled=True
o = 9
Case 9
b.Beep
checkbox8.Text = "2h"
Field1.Text = ""
checkbox8.Checked=True
o = 1
'msgbox "Warten auf Neu"
AnAus
T1.Interval = 1
't2.Interval = t.Interval/60
T2.Enabled=False
btnBeginn.Text = "Beginn"
T1.Enabled = False
Neu
End Select
End Sub
Sub T2_Tick
Field1.Text = Field1.Text & "."
End Sub
Sub T3_Tick
' ResetAutoOffTimer ??
End Sub
Sub AnAus
T1.Enabled=False
T2.Enabled=False
T1.Enabled=True
T2.Enabled=True
End Sub
Sub Neu
Field1.Text=""
checkbox1.Checked=False
checkbox2.Checked=False
checkbox3.Checked=False
checkbox4.Checked=False
checkbox5.Checked=False
checkbox6.Checked=False
checkbox7.Checked=False
checkbox8.Checked=False
checkbox1.Text="30"
checkbox2.Text="5"
checkbox3.Text="30"
checkbox4.Text="5"
checkbox5.Text="30"
checkbox6.Text="5"
checkbox7.Text="30"
checkbox8.Text="2h"
'picture2.Visible=False
'picture3.Visible=False
'picture4.Visible=False
End Sub
Sub btnNeustart_Click()
If Msgbox2("Sicher?", "", "Ja", "", "Nein", Null) = DialogResponse.POSITIVE Then
T1.Enabled = False
T2.Enabled = False
o = 1
btnBeginn.Text = "Beginn"
Neu
T1.Interval = 5
End If
End Sub
Sub btnBeginn_Click
If btnBeginn.Text = "Beginn" Then
T3.Interval=1000
T3.Enabled=True
T2.Enabled=True
btnBeginn.Text = "Pause"
T1.Enabled = True
Else
T3.Enabled=False
T2.Enabled=False
Field1.Text=""
btnBeginn.Text = "Beginn"
T1.Enabled = False
End If
End Sub