Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
22 user(s) are online (16 user(s) are browsing Forums)

Members: 3
Guests: 19

BillE, emeck, sailor, more...

Support us!

Headlines

 
  Register To Post  

DumbPad v01
Home away from home
Home away from home


See User information
Hi all!

After a week of experimenting with Reaction coding (a domain I had never explored before) I managed to put together something, thanks to Dan (Trixie) and suggestions on forum from broadblues and Salas00.
The result might be of interest to some of you:

DumbPad v0.1: https://kas1e.mikendezign.com/aos4/dumbpad/v01/dumbpad_v01.lha

So, this is a simple text editor (yes, another one, I know). My goal was to create a truly minimal yet stable editor, or at least as stable as possible (hopefully, someday).

When I started, I envisioned something basic: just a window with two buttons for Open/Save and nothing more. I began with button.class buttons placed in a layout alongside a texteditor.gadget,
utilizing AISS for images, and it started to look promising:

Resized Image

However, I quickly noticed the absence of a scrollbar, of course. Since I had no experience with Reaction coding, I at first took an old-school way: like i do when coding diskmags 20 years ago: calculating everything
manually to size the scrollbar correctly. It worked, albeit with some precision issues. Then I realized that an RMB menu could be useful, even for a simple editor, to at least include Open, Save, and Quit options.
Added this using the menustrip.class with AISS support, and while I was at it, I added an About windwow (of course! most importan part! :) ) as well (using requester.class).

Resized Image

At this point, things were looking better, and I started using the editor myself. Soon, I found myself missing Cut/Copy/Paste functionality (mostly Cut, to be honest) , but I ended up adding all three. Additionally,
I was annoyed that the text editor area wasn't active by default when clicking the window's border, resizing, or clicking the toolbar area. To address this, I added logic to check for an active window,
ensuring the text editor area is always enabled when expected (thanks for hint, Andy).

Resized Image

Seeing the progress, I realized I also missed a "New" button. I added that too, but launching another instance of the editor just like os4's default notepad felt too much, which led me to consider tabs.
Dan (Trixie) was incredibly helpful again, explaining the key details I needed, and I managed to piece together something functional, complete with bubble help:

Resized Image

At this stage, I encountered bugs with the tabs, various issues, and a codebase that was turning into a spaghetti mess. I also realized that much of my work was redundant! I didn’t need to code scrollbar
support myself—BOOPSI handles that with just a few lines of code. I didn’t need to manually manage every state change in WMHI_* events, as Notifications cover most cases. And I certainly didn’t need to
write a lot of code that essentially did nothing, since BOOPSI takes care of most things. I simply didn’t fully understand at start that there no Intuition-based coding which requires micromanaging every
detail: BOOPSI makes things much easier. Of course, some classes lack certain features one might want, others are overly complicated to set up, but it’s still a far cry from the old-school Intuition coding days,
which is a good thing!

So, with all this, I decided to start from scratch while it wasn’t too late. I opted for a simple window with speedbar.gadget support (since it redraws all buttons in a single call, unlike the button-layout
approach where each button requires a separate call leading to flickering when you have more than a few buttons). I then added tabs, a menu, little bit of functionality, Notifications (thanks to Andy and Dan!), tab naming,
and handling of edge cases like loading empty files or any file type (including binary) by skipping 0x00 bytes (since the text editor interprets them as string terminators). I also implemented iconification,
removed dependency on an external image for the tab close gadget (inbuid them inside of binary), added AISS support for menus and buttons, and made various small tweaks. The result: v0.1 of the dumbest editor ever:

(click for full size):


Resized Image


It definitely has bugs for now, and there are features I haven’t yet implemented (but plan to):

Undo/Redo functionality.
Display file names not only in tabs but also in the window title.
Support for a single command-line argument to specify the name of a file to create.
A bug shared with Notepad (likely an issue with texteditor.gadget or possibly flawed code on my part and the Notepad author’s): if you type quickly and repeatedly click the Save button, after 5–10 attempts -
the Save button becomes ghosted when it shouldn’t. I suspect this stems from how both Notepad (I haven’t seen its source) and my editor handle GA_TEXTEDITOR_HasChanged notifications via idcmphook,
toggling the button state based on editor changes. Alternatively, it might be a logic error in flag management (odd that it affects both editors).
At the very least, I aim to address these four points (plus some minor tweaks), then clean up the code and make it open-source. This way, if any of you find it useful, bugs can be identified and fixed more easily.

Thanks for reading and testing !

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: DumbPad v01
Home away from home
Home away from home


See User information
@kas1e

Great job indeed, well done!
Just wondering, could you able to insert a "Select all" option for the text?

Go to top
Re: DumbPad v01
Site Builder
Site Builder


See User information
@kas1e
Awesome work man. It is great making native apps right?

Follow me on
Ko-fi, Twitter, YouTube, Twitch
Go to top
Re: DumbPad v01
Home away from home
Home away from home


See User information
@samo79
Quote:

Just wondering, could you able to insert a "Select all" option for the text?

This mean you even didn't try it :)

@George
Quote:

It is great making native apps right?


For sure better than some fast ports :) Just more time consuming, but the look and feel much better. It all nice when it's combo : you take something from the today's world, and put bits on ancient things: and there more or less interesting stuff (like, VPDF/AmiPDF with opensource engine, or like Odyssey being native gui but with webkit under the hood).. But wish we spend time on creating more gadgets and improve BOOPSi all the ways around..

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: DumbPad v01
Home away from home
Home away from home


See User information
@kas1e

Not yet indeed, only read your post and look the images you posted
I will try it once i get home

Go to top
Re: DumbPad v01
Amigans Defender
Amigans Defender


See User information
@kas1e

An amazing result in just a week, for a ReAction newcomer! Well done, Roman! I was glad to help where I could.

The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Go to top
Re: DumbPad v01
Just popping in
Just popping in


See User information
Just tried it on my A1222 but it does not even start when I double click or right click to open on the actual icon in RAM or on hard disk?

Go to top
Re: DumbPad v01
Home away from home
Home away from home


See User information
@Boabster
Quote:

Just tried it on my A1222 but it does not even start when I double click or right click to open on the actual icon in RAM or on hard disk?


Should be no differences ram or harddisk of course, and it needs only default os4 classes/gadgets coming with os4 install, and AISS installation. Maybe you have not full AISS installed ? Or maybe broken download and binary corrupted ?

I just disable all debug printfs, and by unluck disable error printfs too :( so if you miss something in system then it silently exit without knowing what happens, will add it just in case, but i hope it's just not installed AISS.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: DumbPad v01
Just popping in
Just popping in


See User information
@kas1e

That worked, installing AISS fixed it.

I noticed some of the other apps I use now have little icons next to its function which was not there or I have not seen before.

But your Dumbpad app is now working normally.

I like it, it is nice, niffy, fast and simple.

I look forward to more little improvements and enhancements on your app.

No need to make it like Notepad++, if you can use Windows notepad as an inspiration, not the AI version, the classic one before Microsoft updated it for your Dumbpad app.

That would be cool to have a similar functional text editor on OS4.

Thanks again.

Go to top
Re: DumbPad v01
Just can't stay away
Just can't stay away


See User information
@kas1e

AWESOMa mate!!!

Just when you iconify it doesn't "use" DumbPad icon.

...
    
// reset icon X/Y positions so it iconifies properly on Workbench
    
if( (iconify=IIcon->GetIconTags("PROGDIR:"PROGNAMEICONGETA_FailIfUnavailable,FALSETAG_END)) )
    {
        
iconify->do_CurrentX NO_ICON_POSITION;
        
iconify->do_CurrentY NO_ICON_POSITION;
    }

...
        
WINDOW_Icon,          iconify,
...


and just text to use fixed font size?
GA_TEXTEDITOR_FixedFont (BOOL) (V50)
Edit using a fixed size font.

Defaults to FALSE.


...
aaand localization


but as said AWESOME work!!!!

Go to top
Re: DumbPad v01
Home away from home
Home away from home


See User information
@kas1e

Finally found some time to test it seriously... well can say it works already well considering you mark it as beta 0.1 )
But of course there are a few must have feature missing:

- Drag&drop: to drop text files on the fly into our editor, this one would be for sure a must have feature for a tiny quick text editor

- Cancel/Restore buttons: another must have functionality but probably absolutely not easy to implement (a pain in the xxx to implement correctly)
Even NotePad of OS4 have problems with this feature especially when going back or forward multiple levels of erase/redo

- If you modify something of a text, but you quit the program without saving, a message should alert the user to save the modificated file before quitting, or just leave it as is unsaved

- A Search feature (of course!)

As a side note, a few minor requests:

- Implement a proper versioning
- AISS icons are nice, but would be extra nice to set them also to use 16 pixel of size
You may even add an icon for the about option afterall
- An iconify option may be added aswell in project menu
- When iconify on WB the program icon is not picked (already reported above by Javier)
- More to come eventually

But aniway, good job friend

Go to top
Re: DumbPad v01
Home away from home
Home away from home


See User information
@Javier
Why GetIconTags(..), why not just IIcon->GetDiskObject("PROGDIR:DumbPad"); ?

ps. and shouldn't we IIcon->FreeDiskObject(iconify); after dispose of window ?
ps2. Ah, it seems that by default winObj have WINDOW_IconNoDispose, false, mean that autodispose of the diskobject happens if not set to true. That explain why i crashes when trying to free diskobject after window closes !

Quote:

GA_TEXTEDITOR_FixedFont


Tried to check how it differs: can't see differences visually. Can you point how to see diff ?

@samo79
Quote:

- Drag&drop: to drop text files on the fly into our editor, this one would be for sure a must have feature for a tiny quick text editor

Tiny-quick mean no features which not necessary for real, i didn't use d&d, so dunno. Besides, what kind of d&d ? From Workbench ? From dopus4 ?

Quote:

- Cancel/Restore buttons

You mean undo/redo ? Yeah i want to add them too, just i have a fear that issues with ghosted buttons when do some undo/redos can be issue with texteditor.gadget in end : it's give you undo/redo notifications, as well as giving you modifcation notification, which is used for "save" button, which, have ghosted bug in notepad and i have it too. So.. that to be seen. Maybe there will be needs to implement undo/redo from scratch..

Quote:

- If you modify something of a text, but you quit the program without saving,

Yeah, that one need it

Quote:

- A Search feature (of course!)

Not sure for that one, as more and more features mean not tiny and more bugs, which need to fix.


Quote:

- Implement a proper versioning

right

Quote:

- AISS icons are nice, but would be extra nice to set them also to use 16 pixel of size


Imho they already small enough ? Anyway, changing sizes and looks of toolbar, mean settings, mean new window, new bugs, and not tiny then.

Quote:

You may even add an icon for the about option afterall
- An iconify option may be added aswell in project menu
- When iconify on WB the program icon is not picked (already reported above by Javier)


Iconify yeah, added


Edited by kas1e on 2025/5/31 20:31:12
Edited by kas1e on 2025/5/31 20:43:33
Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: DumbPad v01
Home away from home
Home away from home


See User information
@kas1e

Quote:
You mean undo/redo ?


Yeah undo/redo, but I realize this is quite a complicated thing.

Quote:
Tiny-quick mean no features which not necessary for real, i didn't use d&d, so dunno. Besides, what kind of d&d ? From Workbench ? From dopus4 ?


From Workbench of course, but maybe even to AmiDock?

Quote:
Imho they already small enough ? Anyway, changing sizes and looks of toolbar, mean settings, mean new window, new bugs, and not tiny then.


I meant the small (AISS) icons in menu, not the icons of the toolbar
Currently they are 24 pixels of size, quite big for menus, expecially on lower resolution, but they can even be sets to 16
There is no need to add any graphical settings for thet, they may be handled by tooltype
Perhaps Javier can help you here, he did so in all of his programs

Go to top
Re: DumbPad v01
Home away from home
Home away from home


See User information
Quote:

From Workbench of course, but maybe even to AmiDock?

And maybe it should also have docx support ? :)


Quote:

There is no need to add any graphical settings for thet, they may be handled by tooltype
Perhaps Javier can help you here, he did so in all of his programs


Like there is difference how handle settings :) Point that introduce any kind of settings, or tooltypes, or whatever kind of different options mean handle different situation in code, different ways, more bugs. My reason for this is minimalistic pad.

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project