HMG application forms help
Moderator: Rathinagiri
HMG application forms help
Hi all,
I am quite new to Harbour & HMG. I have successfully created the main form, a dropdown menu, a indexing form with a progress bar and is working on an user entry form. All this thanks to good people, like CCH, who are kind enough to help me out & also the good examples under the samples folder in the HMG package.
My question:
When I call my indexing form from the dropdown menu, it opens a new window outside & on top of the main form. How can I utilizes only 1 form to accomplish the same? ie. I start the application, the main form opens, I then call the indexing form & I don't want a new window/form to appear but have the progress bar rendered in the same main form.
Or the alternative is to have the indexing form/window opens within the confine of the main form.
Which one or both are doable? Which one is easier?
Thanks.
I am quite new to Harbour & HMG. I have successfully created the main form, a dropdown menu, a indexing form with a progress bar and is working on an user entry form. All this thanks to good people, like CCH, who are kind enough to help me out & also the good examples under the samples folder in the HMG package.
My question:
When I call my indexing form from the dropdown menu, it opens a new window outside & on top of the main form. How can I utilizes only 1 form to accomplish the same? ie. I start the application, the main form opens, I then call the indexing form & I don't want a new window/form to appear but have the progress bar rendered in the same main form.
Or the alternative is to have the indexing form/window opens within the confine of the main form.
Which one or both are doable? Which one is easier?
Thanks.
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HMG application forms help
Hi,
You can have the progress bar rendered in the same main form.
Instead of creating the forms in the runtime, we have to create controls at runtime. Use the 'Parent' for defining a new control at runtime. I will post a small sample soon.
You can have the progress bar rendered in the same main form.
Instead of creating the forms in the runtime, we have to create controls at runtime. Use the 'Parent' for defining a new control at runtime. I will post a small sample soon.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: HMG application forms help
Hi Rathinagiri,
I managed to get the objects to render on the main window by following the example in this topic: http://hmgforum.com/viewtopic.php?f=5&t ... lit=parent
However, after the processing had finished, how do I clear the form?
Thanks.
I managed to get the objects to render on the main window by following the example in this topic: http://hmgforum.com/viewtopic.php?f=5&t ... lit=parent
However, after the processing had finished, how do I clear the form?
Thanks.
Re: HMG application forms help
I did a release of the 3 objects specified:
Main.Progress_1.Release
Main.TextBox_1.Release
Main.TextBox_2.Release
Progress_1 disappeared but the other 2 still remains.
Also, is it possible to clear the window of the 3 objects at one go?
Thanks.
Main.Progress_1.Release
Main.TextBox_1.Release
Main.TextBox_2.Release
Progress_1 disappeared but the other 2 still remains.
Also, is it possible to clear the window of the 3 objects at one go?
Thanks.
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HMG application forms help
Hi Can you give me the sample code?
I wish to know about your HMG version also.
I wish to know about your HMG version also.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: HMG application forms help
Hi Rathinagiri,
My HMG version is 3.0.35.
Part of the code:
My HMG version is 3.0.35.
Part of the code:
Code: Select all
#include "hmg.ch"
Function IndexFile
declare window Main
@ 70,31 PROGRESSBAR Progress_1 ;
parent Main ;
RANGE 0,100 ;
WIDTH 300 HEIGHT 26 ;
TOOLTIP "ProgressBar"
@ 120,155 TEXTBOX TextBox_1 ;
parent Main ;
VALUE " 0 %" WIDTH 60 MAXLENGTH 5
@ 170,31 TEXTBOX TextBox_2 ;
parent Main ;
VALUE " 0 %" WIDTH 300 MAXLENGTH 5
Main.Progress_1.BackColor := YELLOW
Main.Progress_1.ForeColor := BLUE
Main.TextBox_1.Enabled := .f.
Main.TextBox_2.Enabled := .f.
Main.TextBox_2.Value := "Re-arranging Stock Transactions Headers (I)."
use StkHeads
inde on StkHeads->type+StkHeads->reference to StkHeads
Main.TextBox_1.Value := Str(44,3)+" %"
Main.Progress_1.Value := 44
Main.TextBox_2.Value := "Re-arranging Stock Transactions Details (I)."
use StkTrans
inde on StkTrans->type+StkTrans->reference+StkTrans->gold_type+StkTrans->item_type+StkTrans->item to StkTrans
Main.TextBox_1.Value := Str(67,3)+" %"
Main.Progress_1.Value := 67
Main.TextBox_2.Value := "Re-arranging Serial Number."
use Serial
pack
inde on Serial->gold_type+Serial->item_type to Serial
Main.TextBox_1.Value := Str(100,3)+" %"
Main.Progress_1.Value := 100
Main.TextBox_2.Value := "Re-arranging Completed."
close
Main.Progress_1.Release
Main.TextBox_1.Release
Main.TextBox_2.Release
Return Nil
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HMG application forms help
Please check is code. The textboxes are released correctly for me.
Code: Select all
#include <hmg.ch>
Function Main
define window sample at 0,0 width 800 height 600 main
define button b1
row 10
col 10
caption "Press Me"
action showprogressbar()
end button
end window
sample.center
sample.activate
Return
function showprogressbar
define progressbar p1
row 100
col 100
width 200
parent sample
value 0
end progressbar
define textbox t1
parent sample
row 240
col 10
width 100
numeric .t.
rightalign .t.
value 0
end textbox
define textbox t2
parent sample
row 270
col 10
width 100
numeric .t.
rightalign .t.
value 0
end textbox
For i := 1 to 100
sample.t1.value := i
for j := 1 to 200
sample.t2.value := j
next j
sample.p1.value := i
next i
sample.p1.release
sample.t1.release
sample.t2.release
return nil
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: HMG application forms help
Hi Rathinagiri,
I tried your code, copy & pasted as sample1.prg & build using the command: c:\hmg.3.0.35\build.bat sample1
I do see the progress bar but don't see the 2 textboxes. The progress bar do disappeared after the run.
Thanks.
I tried your code, copy & pasted as sample1.prg & build using the command: c:\hmg.3.0.35\build.bat sample1
I do see the progress bar but don't see the 2 textboxes. The progress bar do disappeared after the run.
Thanks.
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HMG application forms help
Hi,
In that case, please use the following code with 'Do Events'
In that case, please use the following code with 'Do Events'
Code: Select all
#include <hmg.ch>
Function Main
define window sample at 0,0 width 800 height 600 main
define button b1
row 10
col 10
caption "Press Me"
action showprogressbar()
end button
end window
sample.center
sample.activate
Return
function showprogressbar
define progressbar p1
row 100
col 100
width 200
parent sample
value 0
end progressbar
define textbox t1
parent sample
row 240
col 10
width 100
numeric .t.
rightalign .t.
value 0
end textbox
define textbox t2
parent sample
row 270
col 10
width 100
numeric .t.
rightalign .t.
value 0
end textbox
For i := 1 to 100
sample.t1.value := i
for j := 1 to 200
sample.t2.value := j
DO EVENTS
next j
sample.p1.value := i
next i
sample.p1.release
sample.t1.release
sample.t2.release
return nil
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: HMG application forms help
Hi Rathinagiri,
Thanks for the working example.
Much appreciated.
Thanks for the working example.
Much appreciated.