This is my first utility in PureBasic written from scratch with multiple windows (my previous experiments have been basic). It was an exercise in learning more about PureBasic and the IDE. It's a simple (no drag and drop) bookmark manager that is specifically designed to import and work with bookmarks exported from the Start.me online homepage site.
Comments about the program.
The built-in Form Designer was used to see what it's like and how easy could I make a simple UI without additional tools, and to work within the bounds of the event loop code that it generates.
I chose to use #PB_Any at every possible opportunity. A slightly tricky result of this was trying different and then deciding on a set of rules for naming that made sense to me for the global variables.
There is no error checking that the file to import is from https://start.me (or in the expected format), or that the number of bookmarks is less than 5000.
Actually, there aren't rigorous checks anywhere (like is the URL valid?), I know that is bad, but it is what it is!
It's a "portable" program and assumes that the folder it is running from is writeable, and that is the only folder that data is stored in.
I should find out how to make "default" buttons in the windows, so the Enter key can be used to make things happen. And generally learn about making keyboard shortcuts.
I plan to learn how to include the PNG files in the program (if that's possible), so they are not separately in the folder.
I would like to launch the browser with a double click on a URL in the TreeGadget, but don't know how to do that, yet.
The TreeGadget gets redrawn totally from scratch when a new item is added (or deleted). It would be better if a new item is just added to the existing gadget items.
Importing overwrites all the existing bookmarks. It might be nice for the import to append to the bookmarks already there, or at least have that as an option.
Threads are not used at all! If the UI freezes, please be patient while it completes. Less than ideal, but I already had to absorb a lot just to get this far, and I didn't have the motivation to learn more about threads for a personal project.
Below are links to a zip file with the program (for Windows), or if you prefer a file with all the sources so you can make it yourself.
The FormDesigner has a bug with Windows Flags under PB v6.21.
You can download the PureBasic-IDE patch from my server here.
Link: OneDrive - PureBasic IDE Patches
Thank you for the positive feedback. I have lost track of the countless hours reading and re-reading the manual, lurking on and searching the forums, and slowly understanding the samples. Hoping to get it right, (or just good enough.)
Will add the CatchImage method (which looks very clever, and I don't think I would have discovered easily myself) to remove the separate files and install that IDE patch!
Maybe I can redo the program with the enumeration and constants way of doing things, and see which I prefer?
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
Here is the latest source to My Bookmark Manager. Improvements are:
The toolbar icons are now included in the executable and do not need to be in separate files. To do this, I had to copy the lines generated by the Form Designer for the Toolbar into my own code because I don't think the Form Designer can use the DataSection information for the images.
Simple keyboard shortcuts of Enter and Esc have been added to the dialogue boxes.
Show an error message if an attempt is made to import too many bookmarks.
Showing the percent progress when importing.
The event loop no longer gets blocked when using the File, Import command. Didn't use threads to do this, but instead switched from using For loops to While loops, that only loop for a limited amount of time before ending the event and using globals to keep track of where they are up to for the next time round.
Started using v as a prefix for global variables that I want to think of as private, even though they are global.
Used the List instead of an Array for breaking up the import text into lines. No real advantage, but just an exercise in learning something new. I don't really understand the List() syntax and am relying heavily on copying from the Help. It's like a list is something like a function, but also a variable at the same time, and can be a magic sort of parameter too. I don't quite get it, but it works!
Realised that I cannot use a List in place of the bookmarks Array because the way I have loops within loops and am running through all the items in the array multiple times with more than one index. Don't think that can be done with a list.
Hi Susan, thank you so much for sharing.
Your app is really interesting. Tested in PB6.30beta3 and works perfectly.
I think you can use list as well, but it can be hard to do.
Something like: