Writing simple GUI - yet another GEM demo coding in C

C and PASCAL (or any other high-level languages) in here please

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

ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2080
Joined: Sun Aug 03, 2014 5:54 pm

Re: Writing simple GUI - yet another GEM demo coding in C

Post by ThorstenOtto »

Just create a dialog with an edit field in it, then use form_do(). For console programs, just use gets() or Cconrs() directly.
pit
Retro freak
Retro freak
Posts: 11
Joined: Sun Jul 12, 2020 4:53 pm

Re: Writing simple GUI - yet another GEM demo coding in C

Post by pit »

ThorstenOtto wrote: Sun Jan 23, 2022 12:58 pm Just create a dialog with an edit field in it, then use form_do(). For console programs, just use gets() or Cconrs() directly.
what I try to have is a real GEM window (so not the console vt52 screen) where I can write text (easy with v_gtext) and input text like in the old adventure text. This cannot be done with a form_do() I think ?

Pit
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2080
Joined: Sun Aug 03, 2014 5:54 pm

Re: Writing simple GUI - yet another GEM demo coding in C

Post by ThorstenOtto »

No, for this you have to the handle the MU_KEYBD events in your event loop, and assemble them to an input line if that's what you need. But this is a bit more complicated, you also need some kind of pseudo terminal where you store the texts, so that you can redisplay them when receiving a WM_REDRAW. You also have to handle all line editing (backspace, cursor movement etc) yourself.
pit
Retro freak
Retro freak
Posts: 11
Joined: Sun Jul 12, 2020 4:53 pm

Re: Writing simple GUI - yet another GEM demo coding in C

Post by pit »

ThorstenOtto wrote: Thu Jan 27, 2022 6:08 am No, for this you have to the handle the MU_KEYBD events in your event loop, and assemble them to an input line if that's what you need. But this is a bit more complicated, you also need some kind of pseudo terminal where you store the texts, so that you can redisplay them when receiving a WM_REDRAW. You also have to handle all line editing (backspace, cursor movement etc) yourself.
ok (unfortunaly) clear... :?
thanks ThorstenOtto :)

Pit
User avatar
jfl
Atari Super Hero
Atari Super Hero
Posts: 921
Joined: Tue Jul 18, 2006 10:55 pm
Location: Liège, Belgium
Contact:

Re: Writing simple GUI - yet another GEM demo coding in C

Post by jfl »

How about a bunch of long blank edit fields one on top of the other and let GEM do most of the work? This may not work at all depending on what you're trying to achieve, though.
m0n0
Captain Atari
Captain Atari
Posts: 431
Joined: Mon Oct 05, 2009 3:13 am

Re: Writing simple GUI - yet another GEM demo coding in C

Post by m0n0 »

Isn't there something called xdialog which handles this multiline text edit object stuff? AFAIK xdialog has extended the textedit fields to handle multiline text inputs.
arf
Captain Atari
Captain Atari
Posts: 255
Joined: Thu May 17, 2012 9:56 pm
Location: Germany

Re: Writing simple GUI - yet another GEM demo coding in C

Post by arf »

jfl wrote: Fri Jan 28, 2022 8:54 pm How about a bunch of long blank edit fields one on top of the other and let GEM do most of the work? This may not work at all depending on what you're trying to achieve, though.
No word wrap, horrible UX for longer texts, so indeed the OP could clarify the target. And perhaps try existing solutions.
m0n0
Captain Atari
Captain Atari
Posts: 431
Joined: Mon Oct 05, 2009 3:13 am

Re: Writing simple GUI - yet another GEM demo coding in C

Post by m0n0 »

Maybe this is not in the scope of the threads topic, but I remebbered ASH E-Mailer (and probably other applications) implemented multi line form objects. It is called "XTED" and extends the TEDINFO Object. It also supports scrolling.

You can find it in the ASH E-Mailer Sources [1], however it't probably not so easy to figure out how it works and maybe it depends on Magic kernel.

[1] ASH E-Mailer Sources: https://www.atariworld.org/download.php?id=213
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2080
Joined: Sun Aug 03, 2014 5:54 pm

Re: Writing simple GUI - yet another GEM demo coding in C

Post by ThorstenOtto »

XTED is a MagiC extension only, and makes use of the EDITOBJC shared library. It doesn't work in TOS (not even with WDIALOG).
User avatar
jfl
Atari Super Hero
Atari Super Hero
Posts: 921
Joined: Tue Jul 18, 2006 10:55 pm
Location: Liège, Belgium
Contact:

Re: Writing simple GUI - yet another GEM demo coding in C

Post by jfl »

I suppose we don't have the sources of EDITOBJC? That would be a pretty neat addition to modern AESes.
joska
Hardware Guru
Hardware Guru
Posts: 5293
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Writing simple GUI - yet another GEM demo coding in C

Post by joska »

Jo Even

VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2080
Joined: Sun Aug 03, 2014 5:54 pm

Re: Writing simple GUI - yet another GEM demo coding in C

Post by ThorstenOtto »

Yes but the source alone does not help much. The SLB relies on an internal MagiC function to hook into the AES function dispatcher: https://github.com/th-otto/MagicMac/blo ... slb.c#L334 That (or a similar mechanism) would have to implemented in other AES, too.
pit
Retro freak
Retro freak
Posts: 11
Joined: Sun Jul 12, 2020 4:53 pm

Re: Writing simple GUI - yet another GEM demo coding in C

Post by pit »

HI all

question.
I use "vst_height" to choose the height of the font (the system font) iused in my text window
with "13" the font appear at the right size in low or medium resolution
but, whatever the size I choose, in the monochrome resolution, the size remain shorter than the normal size (like in the menu)

any idea how to choose the "normal" size of the font in mono resolution ?

thanks

Pit
pit
Retro freak
Retro freak
Posts: 11
Joined: Sun Jul 12, 2020 4:53 pm

Re: Writing simple GUI - yet another GEM demo coding in C

Post by pit »

Sorry, forget my question.... :-)
I had another issue in fact. :-)

Pit
penguin
Captain Atari
Captain Atari
Posts: 239
Joined: Tue Dec 24, 2013 10:43 am

Re: Writing simple GUI - yet another GEM demo coding in C

Post by penguin »

IIRC, the GEM library Windom had special objects for multiline editing...
AtariUpToDate - Atari ST/TT/Falcon software database and version tracker: https://www.atariuptodate.de
ST-Computer magazine - https://www.st-computer.org/
User avatar
mfro
Atari God
Atari God
Posts: 1098
Joined: Thu Aug 02, 2012 10:33 am
Location: SW Germany

Re: Writing simple GUI - yet another GEM demo coding in C

Post by mfro »

use vst_point() to set the font size and check the return value; this will be the next available "real" font size you should set.
m0n0
Captain Atari
Captain Atari
Posts: 431
Joined: Mon Oct 05, 2009 3:13 am

Re: Writing simple GUI - yet another GEM demo coding in C

Post by m0n0 »

penguin wrote: Sun Mar 20, 2022 2:05 pm IIRC, the GEM library Windom had special objects for multiline editing...
typedef struct W_XEDIT:

http://windom.sourceforge.net/doc/html/ ... XEDIT.html

Maybe the structure is initialized by using mt_RsrcXload?

http://windom.sourceforge.net/doc/html/ ... ource.html
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2080
Joined: Sun Aug 03, 2014 5:54 pm

Re: Writing simple GUI - yet another GEM demo coding in C

Post by ThorstenOtto »

No, that function just handles color icons. Its hardly possible for the library to initialize it, since that object type will not appear in resource files.
Post Reply

Return to “C / PASCAL etc.”