Designer for FgGradientButtons

derez

Expert
Licensed User
Longtime User
I was very glad when filippo published his Gradient button library, and immediately started to change the buttons in my application, to improve their look.

I found that when there are many buttons it is a lot of work, so I created a tool.

The main problem is that you cannot locate a Fgbutton on the form using the visual designer, meaning that you have to guess the position, check by running and correct, may be more then once.

So the solution, implemented by the attached tool is to design on the visual designer by putting basic buttons, and then use the tool to convert the buttons to FG buttons. At this point new and old applications are the same.

The process is this:
1. Open the application source with notepad or similar, copy "sub designer" to a new text file named src.txt , save it into the same directory as the tool. Close the source (carefully, don't save it - you may loose it...).
2. Run the tool , press start and look at the three configurations of the button: basic, FG with one color and FG gradient with two colors. Play with the properties and see the effect.
3. When you are happy with the design - press the "select" button next to the configuration you like (one or two colors), or "next" if you want to keep the basic button (unchanged).
4. Repeat until there are no more buttons.
5.Close and open dst.txt file.
6 copy the lines defining the FG buttons to a app_start or a sub in your application, run at application start.
7.Delete manually from the application (using the visual designer) all the buttons that appear in the list at the end of dst.txt file.

notes:- I did not include imagebuttons, but they can be added easily.
- Make sure you have the last version of the fggradientbuttons library.

My reward for this tool is the improved look of your applications :)

Filippo: there is a bug, after declaring a button with new2, width and height can be changed only to decreased size. Looks as if the button is changed but the face bitmap does not.

Edit: version 2, display of button name and operation on both basic buttons and imagebuttons.

Edit: I changed the buttons in the application, using itself. In addition to the process described above I had to change several .color to .backcolor or .endcolor and also fontcolor to forecolor, and to add fs.bringtofront .
ver.2.1 with new buttons.
 

Attachments

  • GraDesigner2.zip
    5.6 KB · Views: 342
  • Images.zip
    19 KB · Views: 318
Last edited:
D

Deleted member 103

Guest
Hi derez,

:sign0098:

These 3 Bitmap are missing:
1) btnCheckedGW.bmp
2) btnExitRW.bmp
3) ColorPalette.bmp


Ciao,
Filippo
 

derez

Expert
Licensed User
Longtime User
You are right. I should have done the same process on the colorpalette module file, because these buttons are defined there.

I am not going to do it because I want to keep the module as is.:sign0089:

Edit: I misunderstood the complaint, thank you Klaus (you bit me again...)

filippo - what about the bug ?
after declaring a button with new2, width and height can be changed only to decreased size. Looks as if the button is changed but the face bitmap does not.
 
Last edited:

derez

Expert
Licensed User
Longtime User
I think that working on the application source itself (even if only by reading) is dangerous because it is not easy to correct it if some damage is done (the IDE refuses to open it...)
The file may be left open if an error happens in the tool.

It is safer to copy the code to another file and work on it instead.

Anyway - the option exist now, let the users decide.
 
Top