Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:30 28 Nov 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 : MMEdit V 5.1

     Page 4 of 8    
Author Message
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6100
Posted: 09:16pm 07 May 2023
Copy link to clipboard 
Print this post

  Volhout said  I am using 5.12 (linux 64 bit) with lots of satisfaction. Only notice that sometimes MMCC sending listing to editor does not work. But since file manager works copying and re-opening in MMEdit works for me just as well.

Volhout


Health is OK. I just had to be gentle with myself for a few days...


To send the listing to the editor, MMCC puts the listing in the clipboard and then uses TCPIP to send the "paste" command to MMEdit.
MMEdit has to be running.

If that fails, the listing 'should' still be in the clipboard so you could start a new file and <paste>.
Let me know if that works.

In the mean time, I will increase the time between making the TCPIP connection and sending the paste command. It might help.


For your other problem, sending files to MMCC, I have change it so even unchanged files are saved before sending when using Linux. I think that might be some sore of permissions problem or perhaps the difference between using a file path starting at the user home compared to the drive root. That did cause some issues in MMEdit.

Jim
VK7JH
MMedit   MMBasic Help
 
ville56
Regular Member

Joined: 08/06/2022
Location: Austria
Posts: 95
Posted: 11:46am 08 May 2023
Copy link to clipboard 
Print this post

I've a problem with listing long programs. "List all" stalls after about 500 to 600 lines of code, "send listing to editor" behaves the same. It stalls not always at the same line.

Is there any restriction on the size of the code MMCC can handle with list commands?

Regards,
Gerald
                                                                 
73 de OE1HGA, Gerald
 
ville56
Regular Member

Joined: 08/06/2022
Location: Austria
Posts: 95
Posted: 11:52am 08 May 2023
Copy link to clipboard 
Print this post

Sorry, forgot to mention the environment
Windows 10, MMCC/MMedit 5.1.2 2023/04/29

But had that also in older versions, at least as far as i remember ...
                                                                 
73 de OE1HGA, Gerald
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6100
Posted: 02:23am 09 May 2023
Copy link to clipboard 
Print this post

Thanks for the report.
I will have to double buffer the serial stream.
It is the picomite driver buffer that is overflowing and I can't change it's size.

For now, you should be OK using the file manager to transfer your current program to MMEdit

Jim
VK7JH
MMedit   MMBasic Help
 
ville56
Regular Member

Joined: 08/06/2022
Location: Austria
Posts: 95
Posted: 05:41am 09 May 2023
Copy link to clipboard 
Print this post

Thank you, Jim. My progs always seem to be a bit oversized.

Regards,
Gerald
                                                                 
73 de OE1HGA, Gerald
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6100
Posted: 07:54am 09 May 2023
Copy link to clipboard 
Print this post

I have successfully transferred a program 2000 lines and 96k so that part is working.
I just have to test it on slow devices to make sure I haven't broken something else.

The other thing to remember when using LIST, set your display to a wide setting so lines don't wrap.
I use
OPTION DISPLAY 40,120


Not sure if that's permitted on the VGA version.

Jim
VK7JH
MMedit   MMBasic Help
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2137
Posted: 08:19am 09 May 2023
Copy link to clipboard 
Print this post

  Quote  Not sure if that's permitted on the VGA version.

It is if OPTION LCDPANEL NOCONSOLE is done first.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6100
Posted: 10:13pm 12 May 2023
Copy link to clipboard 
Print this post

V5.1.3
New features and bug fixes.

Auto-configure will hopefully save users from trying to load programs using the wrong commands.
If Auto Configure is set, the device is queried and the device type in MMCC set to match the actual device.
The option is set by default but can be disabled if you find it too intrusive.

There will always be a conflict between highlighting true keywords (Commands and Functions) and including all or some of the parameters as well.
Now you have the choice. The first"Syntax"  menu item lets you toggle between keywords only and including parameters. Note that it toggles the menu list, not your chosen syntax for a file. You would still have to select the new syntax to see any change. I have deliberately not included parameters that are 1 or 2 characters long. That would be too intrusive.

As part of the above, I have recreated the keyword lists using a semi-automated process. This means that there are probably words I have missed in both settings.

I had a request to allow 'include' files to be stored in their own folder instead of having to navigate to them each time.
Introducing the "store". You can use it as the include file store or just the main code repository. A location that remains the same no matter where you load a program from.
There are "store" alternatives in the file and edit menus.
To set the store folder, hold the <SHIFT> key while selecting "Insert file from store" in the edit menu. Linux users will have to edit the MMedit5.inf file for now.

Fixed a few bugs when in a Telnet session.
Improved "quick hint" <F12> feature to better handle the dots in mm.info etc.
There was a problem in MMCC when listing long programs. This should now be fixed.
I have finally put some of the options in the preferences setting pop-up. (File menu)


Jim
VK7JH
MMedit   MMBasic Help
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 04:01am 13 May 2023
Copy link to clipboard 
Print this post

Thanks Jim,
One funny thing, in 'preferences', if I untick AUTO COMPLETE and save, immediately the:
'
OPTION EXPLICIT
OPTION DEFAULT NONE

loses it's colour coding. Is that correct or do I not understand what is meant to happen?
If I type"
print "Hello"

That is not colour coded either until I re tick AUTO COMPLETE and change the syntax back and forth. I sort of expected that but when I do it, the 'print' is not capitalised and coloured but the "Hello" is colour coded green?

Maybe you can explain another thing. The first time I 'Run in DOS' it takes a while to run the program, thereafter it happens in a flash. I think it is some peculiarity of my PC because I get the same sort of thing with a different program. The previous version (MMEdit4) does the same.

Bill

PS. Thank you for the 'store'. I can now unpin my 'include' folder from explorer.
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 04:10am 13 May 2023
Copy link to clipboard 
Print this post

Addendum: I does work as I expected if I restart MMEdit.

Bill
Keep safe. Live long and prosper.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6100
Posted: 05:25am 13 May 2023
Copy link to clipboard 
Print this post

  Turbo46 said  
Maybe you can explain another thing. The first time I 'Run in DOS' it takes a while to run the program, thereafter it happens in a flash. I think it is some peculiarity of my PC because I get the same sort of thing with a different program.


Blame it on your AV trying to protect you from the nasty world.
It annoys me too.

Windows isn't able to remember the safe programs between sessions.

Jim
VK7JH
MMedit   MMBasic Help
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 05:59am 13 May 2023
Copy link to clipboard 
Print this post

Thanks for that heads up Jim. I'm using windows defender and you can tell it to ignore some programs (add exclusions). I did that for MMEdit5 and now MMBasic for DOS programs run instantly. The other program, Calibre ebook manager, has also improved too I think.

Windows defender doesn't like the MMEdit installation program but that's only an occasional thing.

Bill
Keep safe. Live long and prosper.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6100
Posted: 05:52am 19 May 2023
Copy link to clipboard 
Print this post

MMEdit V5.1.4 is available.

Design – a layout tool for LCD displays (and MMB4W)
You need to have your display configured and OPTION GUI CONTROLS set to a suitable number
Step 1.
New layout design.
A new tab opens with:
  Quote    ' GUI design
  
OPTION DEFAULT INTEGER
  
DIM move = 1
  
DIM ctrl = 1
  
DIM maxctrl,n, a = 2, b = 1
  
DIM cpos(20,5)
  
RESTORE position_data
  
DO
    
INC n
    
READ cpos(n,1),cpos(n,2),cpos(n,3),cpos(n,4),cpos(n,5)
  
LOOP UNTIL cpos(n,1) = -1 AND cpos(n,2) = -1
  maxctrl = n-
1
  
CLS
  Txt$ = 
"Space = next, G = grid, Z = position/size, S = save data"
  
'RUN_ONCE
  
' place any code needed for the GUI elements here eg string$ assignments
  
  
DO
'GUI_ELEMENTS
    
' your GUI elements start here


    
' end of your GUI elements
' Control loop
'LOOP_CONTROL

'USER_DATA
' place your resources here. Fonts etc.




There are 3 sections for you to enter data.
‘RUN_ONCE is where any variables are setup. Just do enough to make the layout look ‘right’.
'USER_DATA is where any fonts needed for the layout will go.
'GUI_ELEMENTS is the main area of interest.
The easiest way to enter GUI controls is type GUI then F12. This opens up a window with a list of all GUI controls and TEXT thrown in for convenience.
Double click on the desired controls to include them in your code.
Some of the parameter fields need to be changed to “real” values. The easiest way to configure colours is to double click on the parameter to select the full word and right click to activate a popup menu with a colour chooser item. Pick a predefined colour or create your own.
There is no need to remove the square brackets, MMEdit will do that for you.
MMEdit will also replace #ref with a ref number and startX etc with a variable ready for moving the controls around.
If you have a number of similar controls such as buttons all the same colour, setup one then ctrl-D to duplicate the line.

Step 2.
Incorporate Layout code.
This step adds the code need to move the elements around the screen and replaces the parameters that need changing.

You are now ready to send the code to your device (or MMB4W) and start playing.
Space bar changes the current control
Z toggles between moving the control and changing the size.
+ and – change the size of any text controls.
G changes to grid spacing 1, 5 or 10 pixels. If you prefer a different gris spacing, you can edit the program to suit.
S saves the position data for all elements as DATA statements.
MMB4W saves the data to a file then sends the file to MMEdit. If BAS files area associated with MMEdit, the file is opened in anew tab. Otherwise, you will have to open the file manually.
With an attached ‘mite the data is displayed in the terminal and you will have to copy and past it into the basic program.
  Quote    'RUN_ONCE
  
' place any code needed for the GUI elements here eg string$ assignments
  
STRING$ = " Hello World"
  caption$ = 
"Start"
  
DO
    
'GUI_ELEMENTS
    
' your GUI elements start here
    
GUI BUTTON #1, caption$, cpos(1,1), cpos(1,2), cpos(1,3), cpos(1,4) , RGB(LILAC) ,RGB(BLACK)
    
GUI BUTTON #2, "Stop", cpos(2,1), cpos(2,2), cpos(2,3), cpos(2,4) , RGB(WHITE) ,RGB(MYRTLE)
    
GUI CHECKBOX #3, "Tick me", cpos(3,1), cpos(3,2) , cpos(3,4) , RGB(GREEN)
    
GUI RADIO #4, caption$, cpos(4,1), cpos(4,2), cpos(4,4), RGB(GREEN)
    
GUI LED #5, caption$, cpos(5,1), cpos(5,2), cpos(5,4), RGB(RED)
    
TEXT cpos(6,1), cpos(6,2), STRING$ ,cm , #2 , cpos(6,5) , RGB(WHITE) , RGB(BLACK)
    
TEXT cpos(7,1), cpos(7,2), STRING$ ,cm , #2 , cpos(7,5) , RGB(BLUE) , RGB(YELLOW)
    
' end of your GUI elements
    
' Control loop
    
'LOOP_CONTROL


Step 3.
Replace variables with numbers.
After you have copied the new DATA statements and pasted them over the original ones, including the last line of -1’s, you use the new DATA to replace all the cpos() array variables with integers.
Step 4.
Extract your code.
Here we open a new tab with your GUI statements ready to incorporate into you program.
  Quote    ' place any code needed for the GUI elements here eg string$ assignments
  
STRING$ = " Hello World"
  caption$ = 
"Start"

    
'GUI_ELEMENTS
    
' your GUI elements start here
    
GUI BUTTON #1, caption$, 1021027020 , RGB(LILAC) ,RGB(BLACK)
    
GUI BUTTON #2, "Stop"1041047020 , RGB(WHITE) ,RGB(MYRTLE)
    
GUI CHECKBOX #3, "Tick me"106106 , 20 , RGB(GREEN)
    
GUI RADIO #4, caption$, 10810820RGB(GREEN)
    
GUI LED #5, caption$, 11011020RGB(RED)
    
TEXT 112112STRING$ ,cm , #2 , 1 , RGB(WHITE) , RGB(BLACK)
    
TEXT 114114STRING$ ,cm , #2 , 1 , RGB(BLUE) , RGB(YELLOW)
    
' end of your GUI elements




If at any stage, you feel the urge to add more controls, do so by placing them after the last control and run “Refresh layout code”. This can be done after step 2 or step 3.
At various stages during the process, new tabs are opened to protect your masterpiece from destruction but it is advisable to save your own copy.
VK7JH
MMedit   MMBasic Help
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 847
Posted: 10:06pm 19 May 2023
Copy link to clipboard 
Print this post

Hi Jim,

{An update: I hadn't closed down MMEdit before I tried Load file and run". Having done that it now works. Andrew}
{{A further update: I've resolved the DO/LOOP issue - see next post}}

I've upgraded to v1.4 but the "Load file and run" icon is not working.
Not just the GUI Design code but any old code.
I've got the syntax set to Picomite, MCC is connected and working (I can list the Pico's file). Is there a setting?

Secondly, in the sample code there is a DO before 'GUI Elements. If I'm running once that can come out?

Cheers,

Andrew
PS: I've also discovered so many other useful things, like double-clicking here and there, as described above; thanks
Edited 2023-05-20 09:34 by Andrew_G
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 847
Posted: 11:58pm 19 May 2023
Copy link to clipboard 
Print this post

Hi Jim,
It is a thing of beauty!

For the notes?:
- (I think?) Numlock needs to be off for the keypad's "+" and "-" keys to work.
- the set of four arrow keys move the target GUI item around.

Some suggestions (only if worthwhile):
- can you possibly re-post to here the full code of the example (it is on the other thread)
- is it possible to highlight which item has focus (eg a change of colour)?
- if you are silly enough to move an item off screen it crashes the program
- is it easy to change the font size on the GUI controls (it may not be as this is set at the start of the program?).

Thanks again,

Andrew
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6100
Posted: 12:52am 20 May 2023
Copy link to clipboard 
Print this post

Thanks for the feedback Andrew.
AS you have found, the DO between the two sections for user entry is part of the code for the main event. I tried to think of something as a place holder that doesn't look silly but decided anything has the risk of users deleting it so I stuck with the DO

Changing size of text looks for the + and - characters, it shouldn't matter which buttons the user uses to send them. I tried to allow for attached keyboards as well as terminals.

I could re-post the full example but the user will create their own, using the latest version.
Changing colour of the selected control is possible but not sure if its' worth it.

Some controls let you move them further off screen than others. This makes a block a bit harder but would be nice. I might be able to incorporate ON ERROR

Anything that is at the start of the program gets difficult to change on-the-fly.

My experience with GUI development is starting to show...

There are two files in the data folder.

newdesign.txt is the code used for a new design and
designloop.txt is the one with the rest of the code.

Users are welcome to modify as much as they like and any ch suggestions are welcome. Be sure to make a backup because they will get overwritten next update.

Jim
VK7JH
MMedit   MMBasic Help
 
Andrew_G
Guru

Joined: 18/10/2016
Location: Australia
Posts: 847
Posted: 02:48am 20 May 2023
Copy link to clipboard 
Print this post

Thanks Jim.
I'm capable of fiddling with your code. If I do anything 'useful' I'll let you know.
(But it won't be for a little while)
It is most useful as it is!

Cheers,

Andrew
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6100
Posted: 03:12am 20 May 2023
Copy link to clipboard 
Print this post

Andrew,
I have added a check for of screen and also let users specify a target screen smaller than the one being used. This is handy when praying on MMB4W.
I need to add a few other drawing elements, not limiting to GUI ones.

Stay tuned.

Jim
VK7JH
MMedit   MMBasic Help
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9129
Posted: 06:50am 20 May 2023
Copy link to clipboard 
Print this post

  Quote  This is handy when praying on MMB4W.


I know it is impressive software - but perhaps treating it as a deity is taking things too far
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6100
Posted: 07:20am 20 May 2023
Copy link to clipboard 
Print this post

  matherp said  
  Quote  This is handy when praying on MMB4W.


I know it is impressive software - but perhaps treating it as a deity is taking things too far

Maybe I meant 'preying'

I do find it very handy to be able to designing for any small screen with the comfort of a big monitor.

I have just posted an update to MMEdit - same version number.

It now checks for going off screen and prevent it from happening.
Also, The list of GUI controls now contains LINE, BOX RBOX etc.
I squashed a few bugs in the "Refresh layout code" section where you add extra controls.

I am sure there will be more to fix

Jim
VK7JH
MMedit   MMBasic Help
 
     Page 4 of 8    
Print this page
© JAQ Software 2024