Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 04:27 03 May 2024 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 : GUI screen pack pure MMBasic

     Page 2 of 4    
Author Message
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 07:24am 24 Mar 2021
Copy link to clipboard 
Print this post

nice. self-configuring. I love it
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 07:39am 24 Mar 2021
Copy link to clipboard 
Print this post

  lizby said  
One thing I notice--perhaps it is because the the radio buttons are themselves red, green, and blue, but it's difficult to tell which one is selected.


OK, I think I got it - and you are right, it greatly improves clarity - Thanks!



the dot can still be any colour but it only shows when selected
Edited 2021-03-24 17:44 by CaptainBoing
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 08:05am 24 Mar 2021
Copy link to clipboard 
Print this post

  TassyJim said  Changes made to run on CMM2

At the beginning:
 if mm.device$ = "Colour Maximite 2" then
   mp = mm.info(option mouse) ' mouse port
   cmm2 = 1
   option console serial
   GUI CURSOR ON 0, 100,100,rgb(red)
   CONTROLLER MOUSE OPEN mp
   mm.fontheight = MM.INFO(FONTHEIGHT)
   mm.fontwidth = MM.INFO(FONTWIDTH)
 endif


Jim


A good tweak, but fair warning - I plan to put support for different fonts in at some point. Having fixed Font H&W at the start will likely defeat this... i.e. FONTWIDTH & Co need to figure in the calculations at the point of use as they may change.

your views?
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8592
Posted: 08:43am 24 Mar 2021
Copy link to clipboard 
Print this post

  Quote  A good tweak, but fair warning - I plan to put support for different fonts in at some point. Having fixed Font H&W at the start will likely defeat this... i.e. FONTWIDTH & Co need to figure in the calculations at the point of use as they may change.


This is great code - thanks for posting and as Jim has pointed out is very useful on the CMM2 as well as the other MMbasic variants.

If you change mm.fontwidth to a function call e.g. get.mm.fontwidth then the code could be completely general and with a few  mm.device$ conditionals could fully support the CMM2 as well. This would be really appreciated.
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 10:12am 24 Mar 2021
Copy link to clipboard 
Print this post

Thanks Peter - praise indeed!

I like the idea of a function call mimicking the font sysvars on the MM
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5911
Posted: 08:46pm 24 Mar 2021
Copy link to clipboard 
Print this post

Here you are:
FUNCTION fontheight() AS INTEGER
 IF cmm2 THEN
   fontheight = MM.INFO(fontheight)
 ELSE
   fontheight = MM.FONTHEIGHT
 ENDIF
END FUNCTION
 
FUNCTION fontwidth() AS INTEGER
 IF cmm2 THEN
   fontwidth = MM.INFO(fontwidth)
 ELSE
   fontwidth = MM.FONTWIDTH
 ENDIF
END FUNCTION


Jim
VK7JH
MMedit   MMBasic Help
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 08:25am 25 Mar 2021
Copy link to clipboard 
Print this post

Hello all.

I have included Jim's modifications in the code. It works straight away on my F407.

If anyone else fancies lifting and shifting the code from the wiki, trying it out and reporting back, please do.

This version doesn't include any new functionality beyond the self-config and platform independence... later.
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 04:26pm 28 Mar 2021
Copy link to clipboard 
Print this post

The slider gadget is now working.

Menus are next.

EDIT: Slider is working if you have the bottom limit at zero (e.g. 0-5).. there are issues for above (e.g. 3-5)... I'll sort it but not today  
Edited 2021-03-29 03:06 by CaptainBoing
 
elk1984

Senior Member

Joined: 11/07/2020
Location: United Kingdom
Posts: 227
Posted: 05:31pm 28 Mar 2021
Copy link to clipboard 
Print this post

This is looking epic.  I started looking at something similar, then (sigh) too much to try and not enough time.  Nice work.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9066
Posted: 05:36am 29 Mar 2021
Copy link to clipboard 
Print this post

Fantastic.  Keep up the good work, Captain!    

Watching this thread with interest.

EDIT: Oh, BTW Captain - very nice article you have written on fruit of the shed.  
Edited 2021-03-29 15:45 by Grogster
Smoke makes things work. When the smoke gets out, it stops!
 
RetroJoe

Senior Member

Joined: 06/08/2020
Location: Canada
Posts: 290
Posted: 04:00pm 29 Mar 2021
Copy link to clipboard 
Print this post

@elk1984, yes, I had exactly the same sequence of thoughts when I first wired up my CMM2 mouse.

@CaptwinBoing, very nice work!  Even more incentive to get my F4 working :)

@TassyJim, thanks very much for the CMM2 tweaks - this is now at the top of my "stuff to play with" list!
Edited 2021-03-30 02:03 by RetroJoe
Enjoy Every Sandwich / Joe P.
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 09:32pm 29 Mar 2021
Copy link to clipboard 
Print this post

if you ignore the little bug with the slider (by not having zero as the bottom limit), I consider this pack is largely ready for an initial release as it contains pretty much all the usual stuff needed for a fairly decent GUI.

What remains is Font support, two types of menu, a tab strip and pop-up windows. These are fairly "exotic" or at least not majorly used (maybe fonts). Hence I spent a while tweaking the code to get it compact, usable and standardized the function names so people can actually start using it if they want.

Further releases will come but I am very conscious of the size creeping up which might make using it on the smaller 'mites a non-starter - it is still around 10K (without the demo prog in the wiki) and so I am hoping won't get in the way too much. This can be mitigated further by "library-izing" it to compact it right down. I haven't done this yet so I don't know how much will  be saved but I do indent my code fairly heavily, so roughly 500 lines * 2 tabs average means it should shave off a K.

Anyone who wants to use it, I would say go ahead as I will endeavor to make further releases backward compatible. can't see anything atm that would break your program. i.e. I won't be renaming the key function calls.

If anyone notices some typos etc in the wiki article etc, be a sweetie and chip in to correct them. Ta. Many thanks to those who have already added code, method and critique, this is a real community effort, so don't be shy.

More to come, but I am working on this only when I get a couple of hours run up so the remaining bits may not come for a month or two.

enjoy.
Edited 2021-03-30 07:33 by CaptainBoing
 
mclout999
Guru

Joined: 05/07/2020
Location: United States
Posts: 430
Posted: 02:51pm 30 Mar 2021
Copy link to clipboard 
Print this post

For one hot minute, We had GUI functions built-in but then it was removed.  Why exactly was that done.  Does anyone remember that we got that in a beta and then it was gone the next Beta aways back?  I was just getting into those functions and they were removed. If this is a good idea why not in the firmware.  Just wondering.
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3016
Posted: 03:51pm 30 Mar 2021
Copy link to clipboard 
Print this post

  mclout999 said  For one hot minute, We had GUI functions built-in but then it was removed.  Why exactly was that done.  Does anyone remember that we got that in a beta and then it was gone the next Beta aways back?  I was just getting into those functions and they were removed. If this is a good idea why not in the firmware.  Just wondering.

This was Geoff's gui implementation for the MM+ and other higher-powered Micromites. Matherp tried them in the CMM2 saying they were provisional and then decided they were antithetical to the spirit of the CMM2.

CaptainBoing's implementation was (as I understand it) originally intended to provide gui functionality for the original Micromite, the 28-pin MM2, for which Geoff's version, with numeric and alphanumeric virtual keypads built in, was too heavy-weight. But the Captain made his version work for all the Micromites, including the F4. TassyJim (& matherp) showed how to easily port this to the CMM2, and that has now been done.

Bringing back the other version to the CMM2 would not solve the Captain's problem with lack of gui function on the MM2.

(But I don't know of any reason why Geoff's version could not be put back into the CMM2 firmware.)
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
mclout999
Guru

Joined: 05/07/2020
Location: United States
Posts: 430
Posted: 07:01pm 30 Mar 2021
Copy link to clipboard 
Print this post

  Quote  But I don't know of any reason why Geoff's version could not be put back into the CMM2 firmware.)
 I was liking it when I had it and now that a mouse is so easy to add it seems like a good idea.
 
yock1960
Senior Member

Joined: 18/08/2020
Location: United States
Posts: 167
Posted: 10:44am 05 Apr 2021
Copy link to clipboard 
Print this post

This is nice and has some good potential!

I've been playing around with it on my CMM2....with a few hiccups. In sub GetTouch, the GUI Cursor Mouse statement needs uncommented....that one had me scratching my head a bit.

After getting past that...oh...maybe add to the documentation that option mouse needs enabled for CMM2 users...I normally leave this off, since it's a bother to have to type 'mouse controller close' every time a program exits ungracefully. This also took me a few minutes to fathom.

Now for some nit picks...minor ones. As copied, the slider pointer is not redrawn after being moved, I fixed this by adding:

GUIObjDraw 71

inside the main loop. Not graceful...but it works. Also, the check/unchecked area for checkboxes doesn't seem to scale correctly to the frame around it...minor cosmetic issue. I haven't played with this...since I don't understand the usage of GUI Bitmap currently.

What I have been doing the last few days, is to make the objects relocatable...since on the CMM2, one can have alot of screen 'real estate' and to add a window sub to make these non-destructive 'popups'. I'm in the early stages of working out a way to have multiple 'popups' on screen simultaneously. The first step is adding a third dimension to the O() variable. Next, I need to think of a way to track window 'focus' and what objects belong to what window. The 'window' really should be added as an object....baby steps!

Steve


GUI_demo_3.zip
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 05:55pm 05 Apr 2021
Copy link to clipboard 
Print this post

Thanks for the feedback Steve.

I have un-remmed the GUI CURSOR MOUSE in the CMM2 switch inside GetTouch - thanks. Not having a CMM2, that bit was done for me and I was putting it in "blind"

You are right about the box on the checkboxes - that was corrected in V0.63

The slider object is re-drawn as it is moved in the "cursor/touch down" section of ProcessTouch() - Case 4 immediately before the Loop at the end of the case (line 181 in my code here) - there should be no reason to redraw in your own program. I am testing on an F4 and it animates nicely, so if there is some difference in action on the CMM2, see if you can catch it and fix in ProcessTouch()

I am really pleased to see you playing and extending the functionality - precisely what this is meant for.

Cheers
Edited 2021-04-06 03:57 by CaptainBoing
 
yock1960
Senior Member

Joined: 18/08/2020
Location: United States
Posts: 167
Posted: 11:14pm 05 Apr 2021
Copy link to clipboard 
Print this post

  CaptainBoing said  Thanks for the feedback Steve.

I have un-remmed the GUI CURSOR MOUSE in the CMM2 switch inside GetTouch - thanks. Not having a CMM2, that bit was done for me and I was putting it in "blind"

You are right about the box on the checkboxes - that was corrected in V0.63

The slider object is re-drawn as it is moved in the "cursor/touch down" section of ProcessTouch() - Case 4 immediately before the Loop at the end of the case (line 181 in my code here) - there should be no reason to redraw in your own program. I am testing on an F4 and it animates nicely, so if there is some difference in action on the CMM2, see if you can catch it and fix in ProcessTouch()

I am really pleased to see you playing and extending the functionality - precisely what this is meant for.

Cheers


Okay, when was v0.63, all I see is page history by number/date. This could be another CMM2 specific issue...although one of TassyJim's images appears to show it fixed.

I think the slider redraw issue may be CMM2 related....how the mouse cursor is implemented...making this change (hiding the cursor while the slider is being moved) fixes it.

                   Case 4'slider
                     Local w
                   -->  GUI Cursor Hide  <--
                     Do
                     .
                     .
                     .
                     Loop
                  -->   GUI Cursor Show  <--

Steve
 
yock1960
Senior Member

Joined: 18/08/2020
Location: United States
Posts: 167
Posted: 11:20pm 05 Apr 2021
Copy link to clipboard 
Print this post

I just discovered what was apparently changed in the Checkbox draw routine. The GUI_bitmap statements were x+2,y+2, but are now x,y. If I put it back to x+2,y+2 the checkboxes are perfect on my CMM2.

Steve
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 08:45am 06 Apr 2021
Copy link to clipboard 
Print this post

Thanks Steve.

I have updated the code to provide your cursor controls inside the slider touch processor.

Can't see that the checkbox needs any tweaking? Could you grab a closeup on the CMM2?

F4 LCD Panel:
 
     Page 2 of 4    
Print this page
© JAQ Software 2024