|
Post by johnno56 on Mar 10, 2022 22:46:20 GMT -6
The next version will have a 'Preview' panel - W.I.P. - (see attached)... The next major step will be the 'scheme loader'... I hope...
|
|
|
Post by johnno56 on Mar 11, 2022 2:01:01 GMT -6
n00b, I have almost completed the 'Preview' panel but some of the 12 items are a little confusing. 'Operators' (assuming mathematical) should contain "+","-","/","*","^" and possibly "=" but also contains parenthesises, comma, semi-colon and dollar. 'Keyword' and 'Keyword2' contains all alphanumeric including 'operators'. (assuming these are the keyword/keywords2 from rcbasic_editor.config) This could present another issue, how is 'schemer' supposed to determine which part of a loaded scheme file is a 'keyword/keyword2'? (could be a can of worms?) lol 'Identifiers' contains variable names, parenthesises, dollar, colon and semi-colon. As you can see there are 'overlapping' attributes... This makes it difficult to correctly display a preview. eg: If I display: 'a = abs(a)' will the parenthesises be assigned to 'Operator, 'Keyword' or 'Identifier'? I know this may sound a bit 'nit picky', and may not effect the overall look of the scheme that much, but I think consistency in scheme design should be considered... Just a thought... I need more coffee... my brain hurts... J
|
|
|
Post by n00b on Mar 11, 2022 16:16:14 GMT -6
johnno56 I will try it out when I get home. To answer some of your questions: 1. Inkey only registers a single key per update which is really not useful for anything. I would recommend you use the ReadInput functions (check out the "Text Editing" section in the manual) 2. The operators should be all operators that are part of the FreeBasic language spec in scintilla. I used that because it was the most compatible. I can try to provide some more clarity on the other attributes when I get home.
|
|
|
Post by johnno56 on Mar 11, 2022 17:10:04 GMT -6
This version includes the 'Preview' panel. The panel is still a work in progress but should give you an idea of how the scheme will look before saving... RC-schemer09.zip (477.97 KB)
|
|
|
Post by johnno56 on Mar 11, 2022 18:07:45 GMT -6
I found all the terms related to 'ReadInput' in the 'Manual' but there were no examples as to how they are used.... If you are able, assuming time permitting, a line or two of each command example would be appreciated...
|
|
|
Post by n00b on Mar 11, 2022 19:17:43 GMT -6
I found all the terms related to 'ReadInput' in the 'Manual' but there were no examples as to how they are used.... If you are able, assuming time permitting, a line or two of each command example would be appreciated... Check this thread out: rcbasic.freeforums.net/thread/384/default-font
|
|
|
Post by johnno56 on Mar 11, 2022 19:50:20 GMT -6
I cannot believe that I had already answered my own question! Thank you for the much needed two-by-four up the side of the head... lol
The dozen lines of code (for ReadInput) does an even better job than the 129 lines of code needed for 'Inkey'.... and Inkey did not include backspace...
The next version will include ReadInput()... Thank you for the assist...
Any tips of how to integrate your parser? The function is already included in the program. I am having difficulty in figuring out how to translate the parsed text...
J
|
|
|
Post by n00b on Mar 11, 2022 20:56:07 GMT -6
Any tips of how to integrate your parser? The function is already included in the program. I am having difficulty in figuring out how to translate the parsed text... I added an example of how to integrate the parser in your editor: RC-schemer09r2.zip (485.39 KB) I put the dark theme in the folder as an example. When you run it, click load scheme and then type in "dark theme.scheme". It will just print out all the color values for each property in the terminal. If scheme_property_name$[4] is style_bkg_color then scheme_property_values[4, 0] is red value for style_bkg_color scheme_property_values[4, 1] is blue value for style_bkg_color scheme_property_values[4, 2] is green value for style_bkg_color All the properties and values will follow that general outline.
|
|
|
Post by johnno56 on Mar 11, 2022 21:01:03 GMT -6
ReadInput() works like a treat!! Thank you!
|
|
|
Post by johnno56 on Mar 12, 2022 0:54:47 GMT -6
A little progress... I created a single routine of ReadInput for the loading and saving. File extension of '.scheme' is now added to the path$ + filename$ string. Saving works just fine. Loading produces the list of parameters as per your example. Your parser use a double array - scheme_property_values[scheme_properties_count, arg_num] - whereas the editor uses a single array - itemColour[]
Regardless of the array issue, returning to the main screen display after loading, still needs to be sorted out. As the program currently stands, the main menu appears in stead... probably just a logic issue... I'll have to think on that one... lol
Possible addition: I have been tinkering with the system() function and managed to display (via console) all the schemes in the scheme directory. Rather than trying to 'remember' which schemes are in the folder, dependent on the OS$, perhaps the filename could be output to a file then displayed on the screen prior to loading. What do you think? I suppose it would be something like creating a reading a hiscore table... Just a thought...
Anyway, my brain is baked for today... Maybe some mindless Doom game will calm the grey cells... lol
Thanks for you help today! Much appreciated. Geany is down for the day. Have a good night/day... You know what I mean... lol
J
|
|
|
Post by johnno56 on Mar 12, 2022 16:24:31 GMT -6
I need to rethink this project. Although I can use it to create a scheme, much quicker than manually creating a scheme, the way I have put it together seems too haphazard. I am not giving up on it. I need plan this out more thoroughly. Back to the drawing board...
To be continued...
|
|
|
Post by n00b on Mar 12, 2022 20:48:27 GMT -6
I know it helps me to draw out a design for an app on paper before I start working on anything. It also helps to break your program down into smaller parts that can be easily changed. It makes your code more extendable if you want to add features or remove them in the future.
Good Luck on your rework.
|
|
|
Post by johnno56 on Mar 12, 2022 23:57:02 GMT -6
I have already started that approach... I have many sketches; some new; some rehashed... tackling one part at a time... Currently working on 'setup' and 'intro'... everything will be done in modules (I think that's the right phrase...) that way problems should be easier to track down... I have not gotten rid of the previous version, as there are parts of it that actually worked, like the sliders for instance...
I am going to try and implement the parser quite early as I would like for the 'default' scheme to be automatically loaded at startup... There is still quite a way to go before I get there... lol
Versions 8 & 9 can still 'create' schemes if anyone wants to make a scheme. I think version 9 introduce the 'preview'....
Many thanks for the tips... Much appreciated... Oh well... back to the salt mine... Moo Ha Ha...
|
|
|
Post by johnno56 on Mar 13, 2022 1:52:31 GMT -6
I was experimenting with loading a scheme (default/dark) at startup and managed to display the 'property names' on the screen with the colour defined by the theme... came across a minor puzzle... nothing wrong with the parser or the editor... it's the colour. Using a palette of 16,777,216 colours... makes it almost impossible to select the right colour for the background screen colour... As the colours are adjusted for each property, at least one of those colours, are going to blend or seem to fade into the background... It's not a 'deal breaker' but just an interesting aesthetics problem... A lot can be said for a simple mspaint palette... lol
If there are any "DaVinci's" out there, with an eye for colour, a 'non-hideous' screen colour suggestion would be appreciated...
|
|
|
Post by johnno56 on Mar 16, 2022 13:33:59 GMT -6
I am in the process of re-designing the scheme editor. I am trying to make it, for all intent and purposes, mouse driven. The only exception would be if a filename is requested.... As RC does not have a 'zone' function* I have, as Rosy rightly pointed out, modified a AABB collision detection algorithm to 'detect' the interaction with the mouse and buttons. Please do not comment about the hideous aesthetics... This is just a test of concept. The test works. What I would like are constructive suggestions on how to make it more efficient. Thanks guys. J buttons.zip (46.88 KB) * ( n00b not a complaint... *gulp*)
|
|