Jump to content
IGNORED

(my) Text Window Libraries


Ripdubski

Recommended Posts

I wrote this library for managing text windows starting in 2015 in the Action! language.  The windows have different ornamental controls.  I've added features I've dubbed gadgets like radio buttons, regular buttons, checkboxes, progress bars, spinners, and input controls that have type restrictions and scroll if they are larger than displayable space.  The gadgets allow building forms which are very close to modern dialogs.  I blogged the progress of the library over the years, and over the last couple of months converted the library to C (CC65).  I blogged about the C conversion as well.  I created full API documentation for both and build some sample apps in each language.  The blog has some video demonstrations.  

 

Once I completed the C version, I decided to create GitHub repositories for distribution rather than my blog.  Maybe someone will find them useful. 

 

The C version now includes support for FujiNet, SIO, and APE Time.  FujiNet bindings include support for Base64 encode/decode and Hashing using SHA1, SHA256, and SHA512.  These updates are not in the Action! library, or the Pascal library.

 

(edit) Amarok converted the C version to Mad-Pascal.  I created a corresponding API document, and published it on GitHub.  Thanks Amarok!

 

Here are the links:

 

C blog entries: https://unfinishedbitness.info/tag/c-cc65/

C GitHub page: https://github.com/Ripjetski6502/A8CLibrary

 

Action! blog with latest release: https://unfinishedbitness.info/2022/08/27/action-library-v1-51/

Action! blog entries: https://unfinishedbitness.info/2016/04/27/action-windows/ (first post on window library)

Action! GitHub page: https://github.com/Ripjetski6502/A8ActionLibrary


Mad-Pascal GitHub page: https://github.com/Ripjetski6502/A8MadPascalLibrary

 

Enjoy.

  • Like 14
  • Thanks 1
Link to comment
Share on other sites

What a great library and the demonstration!

 

There is a lot of functionality and support of multiple GUI controls. I also like your style of coding - it is clear and well aligned.

 

Well done!

 

BTW, do you consider to prepare a port to MadPascal? If you need any support in this matter you can count on me. :)

Edited by amarok
  • Like 1
Link to comment
Share on other sites

On 9/11/2022 at 2:44 AM, amarok said:

What a great library and the demonstration!

 

There is a lot of functionality and support of multiple GUI controls. I also like your style of coding - it is clear and well aligned.

 

Well done!

 

BTW, do you consider to prepare a port to MadPascal? If you need any support in this matter you can count on me. :)

Thanks for the feedback and glad you like it.   I should have posted a notice here when I published the initial version on my blog. I wrote it for myself and was blogging my progression with re-learning the Action! language.  The 1.0 version of the library was picked up from my blog and used in a project not authored by me with success.  Over the course of time, I also found and resolved many bugs.  There is a lot the library could do to protect itself from bad parameters, etc, but I was trying to keep the code size down so only the absolute necessary checks were implemented.  At the end of the day, the library works well and I'm pleased with the result.

 

I was using the Action! version to write a program that started getting pretty large for Action!.  22K binary size.  When I discovered that Action! can only have 2 bytes for function parameters when compiled to stand alone program, that is what prompted me to look at alternative languages.  I like Action! a lot, but it isn't feasible for this project.  The library works well for smaller ones, but will require the cart to be present to avoid the 2 byte limitation.

 

When I started hitting the issues in Action! and started looking at other languages, I did consider Pascal.  I didn't look at MadPascal though.  I looked at the A8 platform Pascals, then at the platform C's before looking at CC65.    I'm not opposed to have it converted to Pascal as well, however I don't have the time at the moment.  The code is on GitHub so if you want to crack at it, go ahead.  I would appreciate credit as the source material if you do so.  

 

As for the coding style, thanks!  I find the code easier to read with plenty of space, alignment, and comments.  Hope you and others find it useful.

Wade

 

(edit) - I'm working on blogging about the CC65 code.  I think is mostly commented well, but I want to draw some comparison to Action! as the same time as clearing up some things.

 

One thing I couldn't test is the processing of F1-F4 on a 1200XL in WaitKCX().  It should work, but I don't have one to actually try it.

 

 

 

 

Edited by Ripdubski
addendum
Link to comment
Share on other sites

20 hours ago, Ripdubski said:

I'm not opposed to have it converted to Pascal as well, however I don't have the time at the moment.  The code is on GitHub so if you want to crack at it, go ahead.  I would appreciate credit as the source material if you do so.

I've just converted your C code into MadPascal. I had to adjust the code a little but the general idea has been kept unchanged, including naming convention.

I roughly checked all 3 applications and they seem to work similar to these from C language.

 

I am not going to put my result on my own gitlab and instead of that I am attaching it to this message. So, you can freely use it for your future work without any limitation.

In the zip file there are sources, binaries and my script for compilation - you need to modify paths to MadPascal and MadAssembler if you whish to compile the code.

 

I hope it will be helpful for you. 🙂

 

A8MadPascalLibrary.zip

  • Like 4
  • Thanks 3
Link to comment
Share on other sites

2 hours ago, amarok said:

I've just converted your C code into MadPascal. I had to adjust the code a little but the general idea has been kept unchanged, including naming convention.

I roughly checked all 3 applications and they seem to work similar to these from C language.

Nice!  If you can provide some basic compile instructions, I'll walk through the code and create an API doc for the Pascal version.  DM your name and I'll credit you for the conversion in the documentation and files (if you didn't already - I haven't looked yet).

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

3 hours ago, Ripdubski said:

Don't use it then.

 

Its crap like this that stopped me from publishing it here before now.  Lesson learned.  I won't share here if this is the reception.

Seems like you took this the wrong way. I sincerely apologise. I was trying to make a joke, but it seems this backfired.

 

I can only echo what the other people have said in the thread already: Great effort, thanks a lot for sharing it with us.

  • Like 1
Link to comment
Share on other sites

On 9/17/2022 at 8:03 AM, ggn said:

Seems like you took this the wrong way. I sincerely apologise. I was trying to make a joke, but it seems this backfired.

 

I can only echo what the other people have said in the thread already: Great effort, thanks a lot for sharing it with us.

GGN was definietly joking as was echoed by the reposnses with the smiling and laughing emoticons other users left. No negative intention was implied here about the OP's work/efforts, so I think it's just a case of crossed wires/a misunderstanding. :D

Link to comment
Share on other sites

1 hour ago, Beeblebrox said:

GGN was definietly joking as was echoed by the reposnses with the smiling and laughing emoticons other users left. No negative intention was implied here about the OP's work/efforts, so I think it's just a case of crossed wires/a misunderstanding. :D

Exactly. Perhaps a language thing? ggn is from Greece.

 

But I got it as meaning there was zero thought about the name, hence zero-thought library (name) :)

 

So, how is the memory footprint of say a menu and a few windows? Are there plans for a file selector? ;) And, how do Action!, C and Pascal compare, memory wise.

Edited by ivop
  • Like 1
Link to comment
Share on other sites

On 9/12/2022 at 10:33 PM, Ripdubski said:

I was using the Action! version to write a program that started getting pretty large for Action!.  22K binary size.  When I discovered that Action! can only have 2 bytes for function parameters when compiled to stand alone program, that is what prompted me to look at alternative languages.  I like Action! a lot, but it isn't feasible for this project.  The library works well for smaller ones, but will require the cart to be present to avoid the 2 byte limitation.

 

I'm not aware that the cartridge runtime allows the passing of any parameter that is larger than two bytes. The largest value in Action! can only be two bytes, whether you use the cartridge runtime or not. I'm not sure how the toolkit FP routines deal with passing FP values or defining them.

Link to comment
Share on other sites

On 9/18/2022 at 12:47 PM, ivop said:

So, how is the memory footprint of say a menu and a few windows? Are there plans for a file selector? ;) And, how do Action!, C and Pascal compare, memory wise.

The library reserves just about 2300 bytes and 10 handles for windows.  You can change it in the header for a given project if you know you need less.  A full screen window will consume 960 bytes of the space.  The application I'm working on uses up to 6 windows at once and I haven't calculated the size consumed, but it works well.  When I get closer to done, I will calculate the exact size and shrink it.  Note you should leave some buffer space in case you call GAlert because it opens a window to display the alert.

 

How do the versions compare?  Action! is/was my preferred language for the 8 bit.  The library works extremely well under it.  The CC65 C version feels a little cleaner code wise and is just as fast.  CC65 is quickly becoming my favorite.

 

Somewhere was an ask about a file picker.  I wire-framed one and created some pseudo code in my notebook, but didn't write gadget code yet.  When i was looking at it, it would be quite large, and with a combination of the existing gadgets, you can construct one.  See the demo app which has an input form.  The file picker would be a type of input form.  One gadget that IS still missing is a drop down pick list.  I have this in my notebook too, but haven't had a time or need to implement it yet.

 

23 hours ago, Alfred said:

I'm not aware that the cartridge runtime allows the passing of any parameter that is larger than two bytes. The largest value in Action! can only be two bytes, whether you use the cartridge runtime or not. I'm not sure how the toolkit FP routines deal with passing FP values or defining them.

Its buried deep in the docs (I just tried to find again, and couldn't quickly).  I stumbled across debugging an error when compiling to disk with the run time.  The 2 byte limitation is for apps compiled to run stand alone without the cart.  When using the cartridge that limit isn't imposed.  Perhaps its still technically there, but the cart works around it. 

  • Like 2
Link to comment
Share on other sites

7 hours ago, Ripdubski said:

 

Its buried deep in the docs (I just tried to find again, and couldn't quickly).  I stumbled across debugging an error when compiling to disk with the run time.  The 2 byte limitation is for apps compiled to run stand alone without the cart.  When using the cartridge that limit isn't imposed.  Perhaps its still technically there, but the cart works around it. 

Do you have an example ? The largest variables are CARD, POINTER and INTEGER, which are all two byte values. It shouldn’t even be possible to define a three or four byte number, and none of the runtime library, like say integer multiplication, allows for anything larger than 16 bits. What were you trying to pass ?

Link to comment
Share on other sites

On 9/20/2022 at 6:48 AM, Alfred said:

Do you have an example ? The largest variables are CARD, POINTER and INTEGER, which are all two byte values. It shouldn’t even be possible to define a three or four byte number, and none of the runtime library, like say integer multiplication, allows for anything larger than 16 bits. What were you trying to pass ?

I still can't re-find the reference and am tired of looking for it.  It is possibly I misunderstood what I read as two bytes (as in parameters) vs two bytes (as a parameter size).  I did find that there is a limit to 8 parameters though, which I was previously not aware of.  I guess I lucked out and all the functions fall under this limit. :D

 

Link to comment
Share on other sites

  • 11 months later...

Greetings all!

 

I have just released version 1.20 of the C Library.  It addition to a couple of bug fixes, it includes the following additions:

- SIO binding

- APE Time binding

- FujiNet bindings for core communication (open/close, read/write, status, etc)

- FujiNet bindings for Base64 encoding/decoding (requires 1.1 firmware built after 2023.08.24)

- FujiNet bindings for Hash coding (requires 1.1 firmware built after 2023.08.24)

 

Many thanks to @tschak909 and @mozzwald for adding functions to the firmware in an expedient manner and building test firmwares for me, and answering multiple questions!  The Base64 and Hash functions should be available in the next published firmware.  In the interim you can download a test build from the FujiNet Discord in the Atari8bit channel.

 

Sample programs included, including source code, as well as 73 pages of documentation.

 

Find it here:

https://github.com/Ripjetski6502/A8CLibrary

 

Enjoy!

Wade

  • Like 6
  • Thanks 2
Link to comment
Share on other sites

  • 5 months later...

Greetings all!

 

I have just released version 1.30 of the C Library.  I neglect to announce 1.21 here, but it included a performance improvement courtesy of @Bill Kendrick.  1.30 includes the following additions:

- Bugfix in WPrint() that appeared under a specific window size and string length condition.

- Borderless / Frameless windows are now supported.  Requires code updates to add additional parameter on WOpen() calls.

- MenuV() replaced by Menu() which adds support for horizontal menus (single line) as well as the previous stacked menus.  MenuV() is supported through preprocessor translation to limit any code re-writes.

 

Sample programs included, including source code, as well as 76 pages of documentation.

 

Find it here:

https://github.com/Ripjetski6502/A8CLibrary

 

  • Like 5
Link to comment
Share on other sites

Greetings all!

 

I have just released version 1.40 of the C Library.  1.40 includes the following additions:

- GList() gadget added, which is a list selection tool.

- Updated demo app which includes demo of new GList() gadget.

 

Sample programs included, including source code, as well as ~75 pages of documentation.

 

Find it here:

https://github.com/Ripjetski6502/A8CLibrary

  • Like 6
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...