Gem dialogs

GFA BASIC-related articles in here please

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Post Reply
sashapont
Captain Atari
Captain Atari
Posts: 153
Joined: Sat Jun 03, 2017 9:40 pm

Gem dialogs

Post by sashapont »

Are there any demo, tutorial, or example for working with dialogs and other gem widgets?
Atari Falcon, Firebee
Moulinaie
Captain Atari
Captain Atari
Posts: 318
Joined: Wed Feb 01, 2012 9:34 pm

Re: Gem dialogs

Post by Moulinaie »

Hi,

Do you want to program GEM ? What language ?

Guillaume.
sashapont
Captain Atari
Captain Atari
Posts: 153
Joined: Sat Jun 03, 2017 9:40 pm

Re: Gem dialogs

Post by sashapont »

GFA BASIC
Atari Falcon, Firebee
User avatar
charles
10 GOTO 10
10 GOTO 10
Posts: 2711
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada
Contact:

Re: Gem dialogs

Post by charles »

prob some of the keywords to search on the forum are
.RSC
dialogbox
file selecter
menu bar
aes message pipe

charles
The radioactive half-life : )
Atari is a lifestyle,not a hobby.
HOLD ON ! ! ! Im printing unreadable characters ...!
User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2512
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: Gem dialogs

Post by lp »

Examples at https://ptonthat.fr/
All source codes can be downloaded.
Playmobil
Captain Atari
Captain Atari
Posts: 186
Joined: Fri Nov 13, 2015 7:40 pm

Re: Gem dialogs

Post by Playmobil »

All articles by Claude ATTARD in the ST-Magazine ! :D But it's in french ! :lol:
sashapont
Captain Atari
Captain Atari
Posts: 153
Joined: Sat Jun 03, 2017 9:40 pm

Re: Gem dialogs

Post by sashapont »

lp wrote:Examples at https://ptonthat.fr/
All source codes can be downloaded.
Thank you! It is very useful for me! U find way to create dialog boxes with recurse manager. Is it possible to create for example buttons in runtime?
Atari Falcon, Firebee
User avatar
Rajah Lone
Captain Atari
Captain Atari
Posts: 454
Joined: Wed Aug 07, 2002 12:27 pm
Location: Lyon / France
Contact:

Re: Gem dialogs

Post by Rajah Lone »

sashapont wrote:U find way to create dialog boxes with recurse manager. Is it possible to create for example buttons in runtime?
"recurse manager" -> I guess you mean "ressource editor". It's the better way. Using "Interface" or "Ressource Master" (provided in the programs set on the FireBee) is easier.
Creating objects from the program is possible, but not an easy task. There are AES functions to handle objects add/delete/etc. You'll have to handle memory block and real C structures.

Better method is to create the object in the ressouce editor, and set or unset the "hidden" flag (+ redraw) to give the feeling that something was created.

Careful about my sources:
- I use the object index directly, not constant names generated by the ressource editor (Ressource Master shows the objc index with the mouse cursor passing on it).
- Most of the time, the dialogs are in not-blocking windows, AES functions are used here and there in the program: it's not the primitive method, but it suits well under multitasking environement.
- start with small programs such as MyJester or fVDISnap, and don't be afraid to rewrite and change my code for you own purposes: it's allowed and strongly advised for learning.
sashapont
Captain Atari
Captain Atari
Posts: 153
Joined: Sat Jun 03, 2017 9:40 pm

Re: Gem dialogs

Post by sashapont »

Rajah Lone wrote: - start with small programs such as MyJester or fVDISnap, and don't be afraid to rewrite and change my code for you own purposes: it's allowed and strongly advised for learning.
I try to cut 2VDI Utilite from Roseta game. I made very simple example only with menu and 2 dialogs. But don't understand how I can make button clickable. They works in resource editor, but not respond in real app
Atari Falcon, Firebee
Playmobil
Captain Atari
Captain Atari
Posts: 186
Joined: Fri Nov 13, 2015 7:40 pm

Re: Gem dialogs

Post by Playmobil »

In the ressource editor, have you checked EXIT or TOUCHEXIT for your button ?
User avatar
Rajah Lone
Captain Atari
Captain Atari
Posts: 454
Joined: Wed Aug 07, 2002 12:27 pm
Location: Lyon / France
Contact:

Re: Gem dialogs

Post by Rajah Lone »

sashapont wrote:I try to cut 2VDI Utilite from Roseta game. I made very simple example only with menu and 2 dialogs. But don't understand how I can make button clickable. They works in resource editor, but not respond in real app
primitive method: FORM_DO -> do everything, but blocks everything. Not counseled under multitasking environment. There is similar functions that does not block the other programs, but are not compatible with every systems.

my method: you handle everything. From the EVNT_MULTI in main procedure, you get keyboard and mouse events. Then with the mouse x, y, click, you find the clicked window (WIND_FIND) and the dialog within it (OBJC_FIND).
If object found under x,y,click, then I change its state (select, unselect) and redraw it with redraw function (black_white function ?).

The dialog is always relocated when the window is moved or resized (OB_X and OB_Y of the object 0 in the tree-dialog).
The redraw function redraws the wanted object (clipping xywh = coordonnates of the object) or the all window content.
Last edited by Rajah Lone on Mon Jan 07, 2019 3:38 pm, edited 1 time in total.
sashapont
Captain Atari
Captain Atari
Posts: 153
Joined: Sat Jun 03, 2017 9:40 pm

Re: Gem dialogs

Post by sashapont »

Playmobil wrote:In the ressource editor, have you checked EXIT or TOUCHEXIT for your button ?
I set this attributes^ but nothing changed :(

https://cloud.mail.ru/public/N9k8/jpASeJMzj
Atari Falcon, Firebee
User avatar
Rajah Lone
Captain Atari
Captain Atari
Posts: 454
Joined: Wed Aug 07, 2002 12:27 pm
Location: Lyon / France
Contact:

Re: Gem dialogs

Post by Rajah Lone »

chemin$ is missing is declare_1: use to locate precisely the RSC file. If empty string, then your program must start from the clicked window. May sound strange, but one can launch your application

Error due to too must cleaning: search in the original source, some ABSOLUTE instructions, which locates m_fenetre& and others variables from the event_multi in the m_adr% block.
User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2512
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: Gem dialogs

Post by lp »

Have a look at the Tim Oren Pro Gem series (English). The examples are in 'C' but the explanations apply to any language. It was the most useful tutorial for me.
Can be found at https://www.dev-docs.org/docs/
User avatar
Rajah Lone
Captain Atari
Captain Atari
Posts: 454
Joined: Wed Aug 07, 2002 12:27 pm
Location: Lyon / France
Contact:

Re: Gem dialogs

Post by Rajah Lone »

+ Errors (still to much code cleaning) : the mouse event (BTST(evnt&, 1 or 0)) is missing, so clicks are not handled. This should go to window-dialog management with win_find and objc_find, parts you have deleted.
Post Reply

Return to “GFA BASIC”