TREE control used as main menu - problems
Moderator: Rathinagiri
TREE control used as main menu - problems
Since I'm new in HMG, I want to take the right direction to create my projects while migrating from Clipper.
My idea is to use TREE control as menu for executing other programs and to make it fluid, fast and with as few clicks as possible.
- I want to split programs - every TREEITEM should have its own PRG
- every PRG creates PANEL type window
- every TREEITEM (PRG) should create its own form and another objects and destroy them after another TREEITEM is double-clicked form MAIN program.
Destroying is necessary because APP could have many PRG's
1) I don't know how to destroy FORM_ARTIKLI or FORM_CATEGORY (called from main program) after another double-click on TREE since ISWINDOWDEFINED(FORM_CATEGORY) returns .T.
- FORM_1.FORM_ARTIKLI.RELEASE and FORM_ARTIKLI.RELEASE return an error in compile: Error E0030 Syntax error "syntax error at '.'"
- THISWINDOW.RELEASE closes main window
2) How to SETFOCUS to GRID_ARTIKLI after TREEITEM is clicked and FORM_ARTIKLI is created?
3) File ARTIKLI.DBF is opened with 4 indexes and I use ON HEADCLICK to SET ORDER.
How to stay on current RecNo() after SET ORDER? If I use GRID_ARTIKLI.REFRESH, it moves on 1st record.
If I don't refresh, GRID_ARTIKLI isn't refreshed and doesn't show correct data.
4) If you double-click on ARTIKLI, then CATEGORY, and back to ARTIKLI - you will still have CATEGORY on your screen
I do understand why, but can you fix it?
5) If you double-click on CATEGORY, then ARTIKLI - you will get an error: Variable does not exist: NAZIV1.
This is what I don't understand since DBF's are opened in different areas and correctly selected.
My appologize for so many questions, but I've tried many combinations, looked in almost every sample, google'd, but nothing helped.
Please^2 help!
My idea is to use TREE control as menu for executing other programs and to make it fluid, fast and with as few clicks as possible.
- I want to split programs - every TREEITEM should have its own PRG
- every PRG creates PANEL type window
- every TREEITEM (PRG) should create its own form and another objects and destroy them after another TREEITEM is double-clicked form MAIN program.
Destroying is necessary because APP could have many PRG's
1) I don't know how to destroy FORM_ARTIKLI or FORM_CATEGORY (called from main program) after another double-click on TREE since ISWINDOWDEFINED(FORM_CATEGORY) returns .T.
- FORM_1.FORM_ARTIKLI.RELEASE and FORM_ARTIKLI.RELEASE return an error in compile: Error E0030 Syntax error "syntax error at '.'"
- THISWINDOW.RELEASE closes main window
2) How to SETFOCUS to GRID_ARTIKLI after TREEITEM is clicked and FORM_ARTIKLI is created?
3) File ARTIKLI.DBF is opened with 4 indexes and I use ON HEADCLICK to SET ORDER.
How to stay on current RecNo() after SET ORDER? If I use GRID_ARTIKLI.REFRESH, it moves on 1st record.
If I don't refresh, GRID_ARTIKLI isn't refreshed and doesn't show correct data.
4) If you double-click on ARTIKLI, then CATEGORY, and back to ARTIKLI - you will still have CATEGORY on your screen
I do understand why, but can you fix it?
5) If you double-click on CATEGORY, then ARTIKLI - you will get an error: Variable does not exist: NAZIV1.
This is what I don't understand since DBF's are opened in different areas and correctly selected.
My appologize for so many questions, but I've tried many combinations, looked in almost every sample, google'd, but nothing helped.
Please^2 help!
- Attachments
-
- OBRADE.zip
- (13.34 KiB) Downloaded 301 times
Last edited by asacaric on Fri Aug 29, 2014 2:44 pm, edited 1 time in total.
- dragancesu
- Posts: 921
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: TREE control used as main menu - problems
There are many people who will help you, but you will most help yourself if you go to make simple programs
Create a MAIN window, and other MODAL, you'll be easier, and then refines
You set the example and it .hbp file, I was expecting to be compiled, but there are errors, one error because you use the latest version
You have problems with the data, (1) it would be ideal to open the program what it needs and ultimately close or (2) open all at the beginning of the application so close to the end, I use the first method
Then you mentioned the problems easier to solve
***
Ovde ima mnogo ljudi koji će ti pomoći, ali ćeš najviše sebi pomoći ako kreneš da praviš jednostavne programe
Napravi jedan MAIN window, i ostale MODAL, biće ti lakše, a posle doteruj
Postavio si primer i u njemu .hbp fajl, očekivao sam da se može kompilirati ali ima grešaka, jedna je greška jer koristiš najnoviju verziju
Imaš problema sa podacima, (1) idealno bi bilo da program otvori šta mu treba i na kraju zatvori ili (2) otvori sve na početku aplikacije pa zatvori na kraju, ja koristim ovaj prvi način
Onda ćeš navedene probleme lakše rešiti
Pozdrav
Create a MAIN window, and other MODAL, you'll be easier, and then refines
You set the example and it .hbp file, I was expecting to be compiled, but there are errors, one error because you use the latest version
You have problems with the data, (1) it would be ideal to open the program what it needs and ultimately close or (2) open all at the beginning of the application so close to the end, I use the first method
Then you mentioned the problems easier to solve
***
Ovde ima mnogo ljudi koji će ti pomoći, ali ćeš najviše sebi pomoći ako kreneš da praviš jednostavne programe
Napravi jedan MAIN window, i ostale MODAL, biće ti lakše, a posle doteruj
Postavio si primer i u njemu .hbp fajl, očekivao sam da se može kompilirati ali ima grešaka, jedna je greška jer koristiš najnoviju verziju
Imaš problema sa podacima, (1) idealno bi bilo da program otvori šta mu treba i na kraju zatvori ili (2) otvori sve na početku aplikacije pa zatvori na kraju, ja koristim ovaj prvi način
Onda ćeš navedene probleme lakše rešiti
Pozdrav
- Agil Abdullah
- Posts: 204
- Joined: Mon Aug 25, 2014 11:57 am
- Location: Jakarta, Indonesia
- Contact:
Re: TREE control used as main menu - problems
I am in the same situation as you are. I am learning from you.asacaric wrote:
Since I'm new in HMG, I want to take the right direction to create my projects while migrating from Clipper.
-Agil
Agil Abdullah Albatati (just call me Agil)
Programmer Never Surrender
Programmer Never Surrender
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: TREE control used as main menu - problems
Hi asacaricasacaric wrote:My appologize for so many questions, but I've tried many combinations, looked in almost every sample, google'd, but nothing helped.
Please^2 help!
First : please don't be pessimist, you are between friends here
- You need use "aliased expression" notation when open more than one table.
- When using same window for more than one control, before show one control, you need close or hide other one.
Here slightly modified version of two of your .prg files.
I hope it will help and give some ideas to you.
Happy HMG'ing
PS : Does "asacaric" is real human name ? ( I don't like address to my friend with "artifical" name )
- Attachments
-
- ART&CAT.zip
- slightly modified version of two .prg files of OBRADE project
- (1.84 KiB) Downloaded 282 times
Viva INTERNATIONAL HMG
Re: TREE control used as main menu - problems
@DraganceSu, thanks for your demo app 'home budget', it surely shows me possible way for develop my apps.
@Agil, good luck
@Esgici, thank you for your help. You've helped me before over gmail. My name is Alen Sacaric. I can't tell you how happy I am now that my app actually works OBRADE.ZIP will be updated with your solution shortly.
Still, I have some remaining issues/questions:
1) Hidden form still uses memory. I really really want to destroy him
2) How to SETFOCUS to GRID_ARTIKLI after TREEITEM is clicked and FORM_ARTIKLI is created?
3) File ARTIKLI.DBF is opened with 4 indexes and I use ON HEADCLICK to SET ORDER.
How to stay on current RecNo() after SET ORDER? If I use GRID_ARTIKLI.REFRESH, it moves on 1st record.
If I don't refresh, GRID_ARTIKLI isn't refreshed and doesn't show correct data.
@Agil, good luck
@Esgici, thank you for your help. You've helped me before over gmail. My name is Alen Sacaric. I can't tell you how happy I am now that my app actually works OBRADE.ZIP will be updated with your solution shortly.
Still, I have some remaining issues/questions:
1) Hidden form still uses memory. I really really want to destroy him
2) How to SETFOCUS to GRID_ARTIKLI after TREEITEM is clicked and FORM_ARTIKLI is created?
3) File ARTIKLI.DBF is opened with 4 indexes and I use ON HEADCLICK to SET ORDER.
How to stay on current RecNo() after SET ORDER? If I use GRID_ARTIKLI.REFRESH, it moves on 1st record.
If I don't refresh, GRID_ARTIKLI isn't refreshed and doesn't show correct data.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: TREE control used as main menu - problems
Yes, remembered; I'm glad to see you again; how are you ?asacaric wrote:You've helped me before over gmail. My name is Alen Sacaric.
First, don''t worry about memory problems; memory nightmares remain at DOS; in Windows we have (almost) infinite memory1) Hidden form still uses memory. I really really want to destroy him
Second: think hiding and showing controls / forms is same as "work areas" concept of xBase. You may have multiple open table
and at a time you activate only one of theme by SELECT.
As most of HMG controls, GRID too have SETFOCUS method; didn't tried it ?2) How to SETFOCUS to GRID_ARTIKLI after TREEITEM is clicked and FORM_ARTIKLI is created?
Save RECNUM() to a variable before SET ORDER and after SET ORDER use GO command to activate that record. fe:3) File ARTIKLI.DBF is opened with 4 indexes and I use ON HEADCLICK to SET ORDER.
How to stay on current RecNo() after SET ORDER? If I use GRID_ARTIKLI.REFRESH, it moves on 1st record.
If I don't refresh, GRID_ARTIKLI isn't refreshed and doesn't show correct data.
Code: Select all
nCurRec := RECNUM()
SET ORDER TO X
GO TO nCurRec
Refresh...
two function called, USE command re-called and the table re-open and "current" record changed.
Instead you can,
- place all USE command in separate procedure (such as "OpenTables"),
- call this proc at beginning of application once, fe before defining any form;
- and then use simply SELECT command ( or SELECT() function for activate that table.
In other hand, instead of linking menu items, using TAB control for GRID of each table may be more convenient.
And a last point : Tree-Menu isn't better than Main-menu control.
Happy HMG'ing
Viva INTERNATIONAL HMG
-
- Posts: 1275
- Joined: Tue Sep 03, 2013 4:22 am
- Location: Tecámac, México
Re: TREE control used as main menu - problems
Hello Mr. Esgici saw the example of partner and you said it all!
greetings Master!
greetings Master!
Re: TREE control used as main menu - problems
Hola
Les parecerá raro, pero yo no había utilizado el CONTROL TREE...
Bueno, les dejo un DEMO tomando como ejemplo lo que posteó asacaric.
------------------------------------------------------------------------
Hi there
It will seem strange, but I had not used the TREE CONTROL ...
Well, I leave a DEMO as exemplified what asacaric posted.
Les parecerá raro, pero yo no había utilizado el CONTROL TREE...
Bueno, les dejo un DEMO tomando como ejemplo lo que posteó asacaric.
------------------------------------------------------------------------
Hi there
It will seem strange, but I had not used the TREE CONTROL ...
Well, I leave a DEMO as exemplified what asacaric posted.
- Attachments
-
- TreMenuDemo.jpg (253.34 KiB) Viewed 5991 times
-
- MenuTreeDemo.rar
- (430.21 KiB) Downloaded 358 times
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: TREE control used as main menu - problems
Viva INTERNATIONAL HMG
-
- Posts: 1275
- Joined: Tue Sep 03, 2013 4:22 am
- Location: Tecámac, México
Re: TREE control used as main menu - problems
+1andyglezl wrote: but I had not used the TREE CONTROL ...