Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:34 31 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Introducing: GUI Editor for the PicoMiteVGA

     Page 2 of 4    
Author Message
Peter63
Regular Member

Joined: 28/07/2017
Location: Sweden
Posts: 89
Posted: 05:03am 07 Jul 2025
Copy link to clipboard 
Print this post

Daniel,

Thanks. I'm glad that Colour Palette can be used in other programs.
I have some ideas for GUI myself, but I'll get back to you.
Some things I've thought about before are "ComboBox" and "ParameterBox", and I think also "pop-up-menu"...
If you can move a mouse cursor on the screen, you must have GUI routines that can handle user input.

/Peter63
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 664
Posted: 06:17pm 07 Jul 2025
Copy link to clipboard 
Print this post

Update:

- Added selection between Numbers only / All Chars (Entry Form)

Now supports these resolutions so more users can test or play with, if they want:

- 848x480 (Widescreen)   <- as seen on the image below
- 720x400 (Widescreen)
- 800x600 4:3
- 640x480 4:3

- small bugfixes





File:

gui_editor_b22a.zip



Greetings
Daniel
Edited 2025-07-08 04:18 by Amnesie
 
Peter63
Regular Member

Joined: 28/07/2017
Location: Sweden
Posts: 89
Posted: 03:52am 08 Jul 2025
Copy link to clipboard 
Print this post

Tested resolution 640x480:



/Peter63
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9608
Posted: 05:20am 08 Jul 2025
Copy link to clipboard 
Print this post

Excellent!    
Smoke makes things work. When the smoke gets out, it stops!
 
Marcel27

Regular Member

Joined: 13/08/2024
Location: Netherlands
Posts: 94
Posted: 06:42am 08 Jul 2025
Copy link to clipboard 
Print this post

Daniel,

Wow, looks very nice this hardware build.

Marcel
 
dddns
Guru

Joined: 20/09/2024
Location: Germany
Posts: 544
Posted: 06:47am 08 Jul 2025
Copy link to clipboard 
Print this post

And the GUI editor looks very nice too!
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 664
Posted: 10:48pm 08 Jul 2025
Copy link to clipboard 
Print this post

Update:

Now everything "basic" is integrated and all is functional...

- Text Item is working now and allows long text line
- Window Item is now completly removable (not everyone wants the window frame!)
- Resolution adjustments and fixes

For the next update, I will finally add the option for more items (of each sort)
current maximum is 3 per item category.


gui_editor_b22a.zip



Greetings
Daniel
 
Peter63
Regular Member

Joined: 28/07/2017
Location: Sweden
Posts: 89
Posted: 03:53am 09 Jul 2025
Copy link to clipboard 
Print this post



/Peter63
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 664
Posted: 06:44pm 09 Jul 2025
Copy link to clipboard 
Print this post

Update:

program size is getting bigger and bigger, so now Library usage is needed - but this is easier than I initially thought (first time for me using this feature).

Save routine is completly excluded in a sub which lives in the Library.

More buttons, more fun:





Gui Editor.zip


Greetings
Daniel
 
Peter63
Regular Member

Joined: 28/07/2017
Location: Sweden
Posts: 89
Posted: 04:27am 10 Jul 2025
Copy link to clipboard 
Print this post

testing...



/Peter63
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 664
Posted: 09:40am 10 Jul 2025
Copy link to clipboard 
Print this post

Peter63.

thank you a lot for the testing! It is funny I had the same in mind you are showing in your test with your buttons, but reached the out of memory error. Now this problems is solved with library and I will allow up to 12 buttons, this way you can integrate a complete Numblock 0,1,2,3,4,5,6,7,8,9 and for example ENTER etc.  

Dropdown menu would be nice, too. I am trying my best to implement one.

I am glad that the library function exists, never thought it would be that easy!

Greetings
Daniel
Edited 2025-07-10 19:42 by Amnesie
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7933
Posted: 10:14am 10 Jul 2025
Copy link to clipboard 
Print this post

Probably not so important in this case, but assuming that you can use the Library as an extension to your own software isn't really very friendly to the user, who may already have their own routines in the library.

Did you consider using CHAIN to split your program into two or more sections?
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 664
Posted: 10:27am 10 Jul 2025
Copy link to clipboard 
Print this post

  Mixtel90 said  Probably not so important in this case, but assuming that you can use the Library as an extension to your own software isn't really very friendly to the user, who may already have their own routines in the library.

Did you consider using CHAIN to split your program into two or more sections?


Thanks for this idea! You are right, If anyone already has a library in the flash slot it isn't that good. Personally I've never used a library, but you are right, I can not assume that this applies to everyone. At least one can save a library and "restore" it etc. so it isn't a real problem only inconvenient.

CHAIN command sounds interesting! Never heard that before. I will consult the manual and think about it. The most important thing is: I MUST save all my global variables when "chaining", if this is possible, then I would prefer your idea.

Because in my global variables are the actually values which needed to be saved. I would exclude the save routine in the second *.bas file, but if this is loaded, I need the variables from the main program. If this is possible, I will do it. But now I need to consult the manual again  

Thank you very much for your input and ideas!!

Greetings
Daniel
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 664
Posted: 10:36am 10 Jul 2025
Copy link to clipboard 
Print this post

Read about the CHAIN idea in the manual but don't really understand if I really need the flash slots; if so there is nothing gained. If another user already has a flash slot used, it is the same with my library approach.

My question is: is chaining also possible on SD-card (with "real" *.bas files), while preserving the variables?

Hm...
Edited 2025-07-10 20:39 by Amnesie
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7933
Posted: 10:52am 10 Jul 2025
Copy link to clipboard 
Print this post

CHAIN works with ordinary files on A: or B:

FLASH CHAIN works with flash slots.

The idea of the CHAIN commands is that you switch to a new program, leaving the variables intact. You can then CHAIN back again, of course. When you use CHAIN it's a good idea to specify the full filename. MMiINFO$(PATH) should return the current path, so it should be reasonably easy to CHAIN to sections of program stored in the same directory or on the same drive that the program was loaded from.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 664
Posted: 10:56am 10 Jul 2025
Copy link to clipboard 
Print this post

Thank you Mick,

this sounds like it exactly does what I want. I will try it. If it works (or I am not to dumb to integrate it) it is the best solution!

Greetings
Daniel
 
Amnesie
Guru

Joined: 30/06/2020
Location: Germany
Posts: 664
Posted: 12:08pm 10 Jul 2025
Copy link to clipboard 
Print this post

Isn't that easy to implement CHAIN, I ran into problems:

What I did so far:

Main program: gui_editor.bas

Excluded save routine: saveRoutine.bas


From the main program I run in my main loop:

 If saveClicked=1 Then Chain "saveRoutine.bas"


then in the "saveRoutine.bas" my code on the top is:


saveWindowToFile()

Sub saveWindowToFile
Open "guiWindow1.bas" For OUTPUT As #2
Print #2, "Option explicit"
Print #2, "MODE 3"
...
...
etc..


And If I run my main program and click the "save" button in my software, the Error occurs:

....Dim "Dim Integer col".. already declared...


Have you any suggestions how to implement this? It seems like I have to say to the inerpreter, that he doesn't need to run through all the (main program) variable declatation again if he is back?! Bu the strange hing is, for now I have no "back chain" to the main program from the "saveRoutine.bas"... Why he goes back anyways? Hmm.. Tried different debugging methods to see if he jumps into the chained program at all, seems like he don't... (I tried with some PRINT debugging in the chained program like "hey I am there") end even "END", so that he doesn'tt go back to the main program.. but always the same error: "already declared"

My files:


Gui Editor1.zip



Greettings
Daniel
Edited 2025-07-10 22:18 by Amnesie
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2638
Posted: 01:27pm 10 Jul 2025
Copy link to clipboard 
Print this post

  Quote  ....Dim "Dim Integer col".. already declared...
Perhaps use ON ERROR SKIP x ahead of all the DIM lines, or use a flag in an IF to skip over all the DIMs if it has been set in  "a:saveRoutine.bas".

  Mick said  When you use CHAIN it's a good idea to specify the full filename.
So perhaps the drive letter should be included.

A mistake I keep making is forgetting to update the file copies of the two programs after editing. That gets confusing!

Here is a test of chain, added to another program.
> LIST
Print "This is envelope generator.bas"
If x<>4 Then Chain "a:saveRoutine.bas"

Print "PLAY LOAD SOUND envelope generator for multi cycle waveforms"
.....
and a test version of saveRoutine.bas
> list "saveRoutine.bas"
Print "This is saveRoutine.bas  x =";x
x=4
? "now x =";x
Chain "a:envelope generator.bas"
>

and the output
> RUN
This is envelope generator.bas
This is saveRoutine.bas  x = 0
now x = 4
This is envelope generator.bas
PLAY LOAD SOUND envelope generator for multi cycle waveforms

Edited 2025-07-10 23:29 by phil99
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7933
Posted: 02:15pm 10 Jul 2025
Copy link to clipboard 
Print this post

I hope you aren't DIMing in the CHAINed program. There's no need to as within the CHAINed section all DIMs have already been done in the main one.

Also, don't put the CHAIN command in a SUB or FUNCTION or you'll mess things up because it won't know where to return to. Call it from your main program loop.

Programs for CHAINing can be awkward to test as they have no variables specified by DIM. It's an idea to put those statements in a block and, before saving it ready for CHAINing, comment the block out. You will need to put the DIM statements in your main prgram like that, but you shouldn't get DIM errors as the variables will have been predefined at the start of the CHAIN.
.
Edited 2025-07-11 00:23 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Peter63
Regular Member

Joined: 28/07/2017
Location: Sweden
Posts: 89
Posted: 05:31pm 10 Jul 2025
Copy link to clipboard 
Print this post

Test this:

1. LIBRARY DELETE
2. LOAD "saveRoutine.bas"
3. LIBRARY SAVE

Otherwise, it seems like DIM found within Print #2, "Dim Integer col" etc. are interpreted in the file as DIM instructions. Which seems a bit unfortunate.

Sub saveWindowToFile
Open "guiWindow1.bas" For OUTPUT As #2
Print #2, "Option explicit"
Print #2, "MODE 3"
Print #2, "CLS"
Print #2, ""
Print #2, "'GENERAL variables -------------"
Print #2, "Dim Integer col"
Print #2, "Dim c1(16) As integer 'PicoMiteVGA colour palette"
Print #2, "Dim integer refresh=0"
Print #2, "Dim integer once=0    'only allow retriggering once"


I know I've had some strange things happen if I don't delete the library first with LIBRARY DELETE.
Just trying it out but otherwise it seems a bit ???

/Peter63
 
     Page 2 of 4    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025