TheSaint

GUIBuilder Project

11 posts in this topic

#1 ·  Posted (edited)

For quite some time now, I have had it in mind to redo and upgrade Cyberslug's GuiBuilder (also called AutoBuilder).

Well, that time is finally here.

Why you ask?
{1} I have always preferred its no nonsense simplicity that allows you to get down and dirty with coding quickly, not hampered by other elements taking up screen space, etc.

{2} It is the main reason I am still coding with AutoIt v3.3.0.0 ... the last supported version by GuiBuilder.

Haven't others made attempts at updating GuiBuilder? And why not help them?
{3} Yes they have. The latest probably being GuiBuilderNxt by jaberwacky, who I did assist to a minor degree.

{4] While I have great respect for the work he did, and that done by others, they were not really working on the type of update I wanted. I just wanted an update, with very few extra bells & whistles.

{5] I also want a version that I can maintain, that is written in a structure I understand more easily than it currently is. In short, I want it written in the style I code in. To do that, it is necessary that I set aside time, to dissect the last version of GuiBuilder (which was the one I updated to support AutoIt v3.3.0.0), so that I can more fully understand what is going on. In the past, my updates, have just been simplistic tweaks to existing code, without understanding anymore than I had to. This time, it will be entirely different.

{6} I don't work well with the way other people code, and it will be enough of a struggle deciphering things as it is.

But seriously, why not just use one of the existing GUI creators?
{7} I am well aware of all those, but none have the simplicity and directness I want. Apart from basic GUI elements, I manually code everything or copy & paste from prolific examples I have built up over the years. I like to keep things simple, and that extends to less clutter on the desktop working environment ... less to look at.

Is this project a collaborative one?
{8} NO, not at this stage. It may become that, to some degree, if I get stumped by something. After I have finished the project though, it will be open to others to extend, so at that point it could become collaborative under a slightly different name ... remembering all the points I mentioned previously for my version - maintenance etc.

Finally.
{9} GuiBuilder or AutoBuilder as it was called at one point, was the very first GUI creator for AutoIt, which you can read about here. I would like to do justice to it and Cyberslug, the original creator, for it was a very important part of AutoIt when it first came out, and was for a very long time, part of the AutoIt install, even for a while after Koda was first included. When it was eventually superseded, I well remember Jon asking if anyone was willing to update it, so that it could be kept as part of the AutoIt install, but as an example only. Some time later, I tweaked it, so that it would work with AutoIt v3.3.0.0, but I didn't revamp the code, which was pretty much all over the shop, so ultimately it wasn't suitable as an example.

So here's hoping. Especially as life has a habit of intruding and sending things awry.

Wish me luck!

P.S. It is my intention to report here from time to time, on how things are going .... maybe even provide some code, discuss difficulties, plans, methods, etc.

Source.au3  (last version, Prototype 0.9, supports AutoIt v3.3.0.0 and Win XP) (no resources provided yet, just for reference)

Screenshot of v0.9

Guibuilder_2.png

 

Edited by TheSaint
Completeness
3 people like this

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites



STEP 1

Recreate the GUI part.

That means, making a copy of the script, that I bit by bit remove sections of code from.

The first lot of code, will be all the GUI related code, which I will convert to my style - declarations, layout, naming conventions, etc.


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites
6 hours ago, TheSaint said:

Wish me luck!

I wish you best of luck :thumbsup:

1 person likes this

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

Thanks buddy, from what my re-investigations so far have revealed, I will need it.


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Added source for original script to first post, along with a screenshot.

BLOG
Not an auspicious start so far.

Not long after starting this topic, and before I started any work on the project, I got a visitor who stayed for 3 hours. I also got some kind of infection or virus out of nowhere which drove me to the Loo for a pee every 5 to 15 minutes (today, that has all but disappeared, after plaguing me all day yesterday) ... could be alcohol related as I don't drink much these days, but did partake a bit more than my usual the night before, with some Moscato ... a piddly (sic) amount by the regular standards of most people ... but I do have a low alcohol tolerance these days ... my body treats it like a poison ;).

Anyway, I eventually made a start yesterday, and worked on things for a couple of hours, which eventuated in a bit of code. I have done some more code etc today.

Here's what I did yesterday, which you can try if you like. It doesn't do much other than save code for a blank GUI, which you can determine the size of.

Project.au3

background.bmp  (required resource to show grid pattern)

NOTES - I'd forgotten what a complex mess the GuiBuilder script is, and so I have come to the conclusion that I may just fail in this project. I will try hard not to though. At the moment I am just extracting the basics and working on modifying them, based on how much I understand plus my AutoIt/coding experience & knowledge. However, those last, may not be up to the task.

My investigations so far, have led me to believe that the script, by today's standards is full of a lot of unnecessary crap. A lot of things that are declared, are part of the standard Include files now, so I should be able to strip most, if not all, of them out. But already there are a bunch of things I don't understand, and a lot of magic numbers being used.

So it looks like I will be building from the ground up, extracting bits as I go, and getting them working, before I move onto the next lot ... which of course, means understanding what is going on.

I am guessing, that a lot will end up being trial & error.

In the end, if I don't understand enough to do as I hoped, I will hopefully at least, have a working update that works with latest AutoIt. That is the most important thing I guess.

Edited by TheSaint
1 person likes this

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites
9 hours ago, TheSaint said:

In the end, if I don't understand enough to do as I hoped, I will hopefully at least, have a working update that works with latest AutoIt. That is the most important thing I guess.

 

Indeed, that's the most important part ;), no benefit if you cannot use that with the latest version :D

1 person likes this

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Here's what I did yesterday, which you can try if you like. It doesn't do much more than my previous script, but some visual elements are now working on the Toolbar GUI. NOTE - The icons don't look as good anymore, see the Blog below for an explanation. At a later date I may improve the icons.

Some of many coding improvements
The 'Settings' menu item, had one entry (Show hidden controls) that didn't do anything, which I renamed and got working (just shows/enables the greyed out buttons). Win API is now used to repaint the Main window, instead of Splash work-around. Etc.

Project.au3

(Resources required)

IconSet.icl  (32 bit)

blank.bmp

(original resource)

IconSet.zip  (16 bit) ... doesn't work in Win 7 ... or beyond I imagine.

BLOG

Well, a goodly amount of time was wasted yesterday, mostly dealing with non code stuff for the project.
I'd done a chunk of code earlier in the day, but then had some issues when testing a compiled version on my Win 7 Netbook.
One, menu items on the Toolbar GUI weren't locating where they should be, and two, the button icons on the Toolbar GUI weren't showing.

At that point, it was obvious it was time to install AutoIt on my Netbook, for the first time.

Up until yesterday, all my coding in recent years, has been on my Win XP Laptop, with the latest version of AutoIt being v3.3.0.0. I won't go into all the reasons for that, because there are a few, but chief among them, was not having AutoIt on my Netbook, in case I be tempted to do coding while away on holiday, as the Netbook usually goes with me. Another good reason, is that my Laptop is a more powerful machine and has a better coding environment, not least of all because of its much larger new external monitor, but also because it is zippier, has a better external keyboard and a more comfortable computer chair. It also has a lot of stuff installed and setup on it, that assist and improve my coding experience ... some of which, are why I haven't upgraded beyond v3.3.0.0 of AutoIt.

So, I installed the latest version of AutoIt (September 2015), but had issues with the install. I started drafting a topic for the MVP Chat section, to discuss those issues, but then later wisely decided not to publish. That was my first real wastage of time. In the end, I just uninstalled, checked and backed up a few Registry entries, then deleted them.

I then re-installed the latest version of AutoIt, and things went well enough, mostly due to my Registry changes, but also because I realized why C:\Program Files wasn't presented as the fallback when deciding to install to other than the default location. I still see it as an issue, but one with the Installer program itself. Chiefly you need to remove the 'AutoIt3' portion of the default path, so that a non-existent path is not the starting off point for browsing. I hadn't thought to do that first time around, and so the top of the tree (probably Desktop) was presented to me ... which always annoys me greatly ... having to then work my way back down the tree to C:\Program Files. Just for the record, I install to C:\Program Files\Tools\AutoIt3.

The second, more important issue I had, which was why I had decided to start the topic I never published, was in relation to right-click options. I had never installed AutoIt on my Netbook before, but I had some time ago, manually installed the latest Help file (for the time), and then later SciTE to C:\Program Files\AutoIt, and also created some Registry entries. Those last got screwed by the first install, while at the same time ensuring that new right-click entries didn't work. Obviously some parts of my original entries, were named other than expected, and the only sensible solution, was to uninstall and make the changes I mentioned above, then re-install.

So anyway, a good amount of time was wasted getting all that done, but at least I now have the latest AutoIt installed and seemingly working properly. However, due to the time wasted with that and later issues, I never did get around to installing the full version of SciTE yet.

With AutoIt finally up and running, I decided to deal with the two Toolbar GUI issues. I tackled the Menu item (button) placement issue first.

On my Win XP Laptop, with original settings, I had 3 rows of Menu buttons (items), made up of three buttons on first row (Settings, Properties, Exit), three on second row (LoadTemplate, Info, Vals) and two on the third row (SaveTemplate, About). Some of the keener eyed amongst you will have noticed, that I have replaced the original 'Definition' text with 'Template', which to my mind, is a more accurate description, that also has the benefit of being a little shorter. After those three rows, there is 7 rows of Control buttons, in 3 columns. They all display correctly on my Win XP Laptop.

On my Win 7 Netbook however, I instead have 4 rows of Menu (items) buttons ... obviously some kind of font related issue, that causes extra wrapping, with the result that things not only look crap, but the 7th row of buttons are only half showing in height, truncated by GUI height.

It must be noted, that wrapping was already in play, due to the width of the Toolbar GUI, as on a wide enough GUI, all those Menu buttons would be on one line at the top.

I thought that the quick easy solution, would be to change either the default GUI font, or the font of the menu buttons themselves. But after much mucking around, that proved a non event, and just didn't work. I went all the way down to Small Fonts and Size 6, with no visible change to Menu items. So that was another waste of time. I then had no option, but to resize the GUI and Control buttons, which took a bit of trial & error to accomplish the right values. So buttons that were originally 50 x 50 pixels, in the end were 56 x 56 pixels, and the GUI widened by about 18 pixels, until Menu (item) buttons would display correctly. I also had to increase the GUI height to match.

So with that finally fixed, I addressed the non showing icon images.

The Control buttons, are in fact, Radio buttons, acting as push buttons. At first, I thought it may be an issue related to numbering, but after tinkering a little to no success, I then went online to investigate. It quickly became obvious that the problem was probably related to 16 bit ... and Win 7 does not support such an (.icl)  Icon Library file. So I then went searching for freeware conversion solutions, which proved to be harder than I thought.

In the end, I had to extract each icon, using IrfanView on my Win XP Laptop, then on my Win 7 machine, use a fully working trial program (GConvert 5) to recreate the Icon Library file (.icl), and that worked for the Toolbar GUI, and the icon images now show, if not as nicely as the original on Win XP. Win 7 obviously uses a different shade of grey as the default button color. After extracting the icons with IrfanView, it appears they were already converted to 32 bit, so I didn't need to do anything in that regard.

Most of the time I wasted yesterday, was in relation to fixing the icons ... finding the right program(s). None of the programs I tried, and there were several, would recognize the original Icon Library file. The ones that actually supported ICL files, kept saying there were no icons inside our file, GConvert 5 included, despite what I had been led to believe. Even IrfanView on Win 7 refused to see any icons too.

In the end, all was solved, but by then I had no more time or energy for more coding that day. I also started feeling unwell again by that time.

Today, I am just relaxing so far, doing this post, and I may or may not do any coding ... including installing full version of SciTE.

SCREENSHOTS

Before the fixes.

Before.png

After the fixes.

After.png

Edited by TheSaint
improvements
1 person likes this

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

BLOG

None of what I am saying in this post, is a criticism of CyberSlug, as I feel I am all too aware of how and why GuiBuilder was just whipped up the way it was. In fact, it feels like something slapped together from various bits and pieces and rearranged often, both adding & removing elements as the experiment advanced. I don't think it was ever meant to live for long. Neither is it a criticism of others who have also tinkered with the code.

---------------------------------------------------------------------

Well, after having a break from coding for a few days, I felt sufficiently refreshed today to dig deep, and that is what I did.

After a few hours of good solid work, I eventually became so confused with several elements, that I had to stop and consider my options.

In the end, I decided to integrate what I had done so far, with the original code, cleaning up the original code as I went. Then in a day or five, I would try again, from a better position.

The re-integration & cleanup initially went well, but I was increasingly becoming more and more confused, as I realized just how bad a state the original code was in. There are several reasons why I don't like working with other people's code, and top of that list would be mistakes and bad practices that hamper your understanding, as well as concepts beyond my skill-set. I fear this ticks all the boxes in that regard.

You have variables that appear in both upper and lower case, and the same or others declared in both the Local and Global scope. You have elements that have been declared, but are not in use, looking important but not actually doing anything. I generally like short variable names, but single letters that are used for one thing one moment and something very different the next, that would only work (if some of them are indeed working), because they are in the Local scope. Then you have double letter ones, etc. Often it seems to me, you could get rid of most of them, because many seem to be doing the same thing, but following the logic to determine this, is an agonizing process. With very little comments and variable names not descriptive enough, it has become a nightmare, that would take a mountain of work to fix. Add to that the degree of difficulty from my lack of understanding of some things, and I fear to proceed lest some untoward thing happens, when I run the code eventually. And then there is the good chance of failure after all that work, and then because I have committed that far, continuing to reach for a solution, perhaps futilely. So wasting my time is also of great concern.

I definitely don't know enough, to be a good troubleshooter of other people's code, especially when I come across seeming mysteries and contradictions or conflicts in the code.

Honestly, it is a wonder the program actually works as well as it does.

I think I can see why CyberSlug hasn't returned to it in many years ... and he understood it.

I must be remembered too, that when CyberSlug started work on this GUI builder, it was very much experimental ... being early days for GUI's with AutoIt, with many things we take for granted now, still being developed. So in a sense, GuiBuilder (AutoBuilder) was very much an exercise in proof of concept, as well as a very helpful tool at that time. CyberSlug, I am guessing, essentially abandoned his experiment, when others started to work on alternates and when Koda came along. I guess he was never counting on some like me, becoming passionately attached to his effort.

Where to from here?
Tomorrow perhaps, I will review things again, but it seems to me right now, that I should start again with the integration, and do no more than that. With any luck, that might mean the program is at least usable with latest AutoIt. If someone braver and smarter than me, then wants to take on the challenge of improving it further, then that would be great. I do like a good challenge, but it has to be an enjoyable one ... I like being creative and I like learning ... to a point. For me, it is as much about the journey as it is the result. If the journey becomes too unpleasant, then you do something else ... Life is too short to waste it on things you don't like doing.

Edited by TheSaint
1 person likes this

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites
2 hours ago, TheSaint said:

There are several reasons why I don't like working with other people's code, and top of that list would be mistakes and bad practices that hamper your understanding, as well as concepts beyond my skill-set.

 

Very true

2 hours ago, TheSaint said:

With very little comments and variable names not descriptive enough, it has become a nightmare

Long variable names for the win :D

 

Regarding the original codebase, I think it is how exactly described by @TheSaint, It is just a proof of concept for GUIs in AutoIt... It was not written with long time development in mind, therefore, I think we should start fresh, borrowing some code but making everything consistent... consistency is the key ;)

 

1 person likes this

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

#10 ·  Posted

On 23/1/2017 at 4:24 AM, TheDcoder said:

.....I think we should start fresh, borrowing some code but making everything consistent... consistency is the key ;)

The problem for me, is dealing with things I don't understand, which I was hoping to get insight on, but which to me, has just become too difficult ... they are beyond my skill level or pay grade. Chiefly, this is moving controls around and resizing them with your mouse. I only have a vague idea about all that, and from what code I have been able to make a little sense of, it seems that some Windows trickery is at play, which I don't know the rules of.

For starters, the program creates a miniscule GUI and then places a bunch of miniscule grippy handles to it, then resizes the GUI to full size. I don't understand any of the reasoning for that (only wild speculation & guesses). Not that I ultimately probably needed to, so long as it works and I do nothing to mess that up. I do however need to have some overall grasp of what is going on to make it coherent enough. So trying to get the big picture is the ultimate problem. Some things take precedence over others and need to ... and that is just the tip of this Iceberg.


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

#11 ·  Posted

thanks man

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now