Toolbar gadget in Form Designer

You need some new stunning features ? Tell us here.
RobertSF
User
User
Posts: 61
Joined: Thu May 03, 2018 4:24 pm

Toolbar gadget in Form Designer

Post by RobertSF »

In Form Designer, you can't select a Toolbar gadget and set its properties, so all toolbars are created with #Toolbar of 0. This means that if you have form 1 with a toolbar, and then you open form 2 that also has a toolbar, the toolbar from from 1 will disappear because the toolbar in form 2 overwrites the one in form 1.

It's the same situation with the StatusBar gadget.

There are two workarounds. You can manually change the toolbar number in the form code after using the designer. You'll just have to remember to make this manual change after every time you use the designer. You can also recreate the toolbar in code when form 1 becomes active again.
User avatar
mk-soft
Always Here
Always Here
Posts: 5333
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Toolbar gadget in Form Designer

Post by mk-soft »

My Eventdesigner build a right commonfile.pb from pbf-files.

Link: viewtopic.php?f=14&t=65033
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
RobertSF
User
User
Posts: 61
Joined: Thu May 03, 2018 4:24 pm

Re: Toolbar gadget in Form Designer

Post by RobertSF »

Thank you! I will take a look.
RobertSF
User
User
Posts: 61
Joined: Thu May 03, 2018 4:24 pm

Re: Toolbar gadget in Form Designer

Post by RobertSF »

I'm sorry, but while EventDesigner is impressive, it doesn't seem related to the issue I posted.

The issue is that you cannot really create forms with toolbars and status bars in Form Designer because they all wind up with the same ID. You have to manually edit the code, but those edits disappear when you reload the form in Form Designer, of course.
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Toolbar gadget in Form Designer

Post by Marc56us »

Yes, it is indeed a pity, especially since the form designer knows how to deal with all the other gadgets as soon as they are created in the same session or the same project. (He does give a different number)

Also, it would be nice if the form designer could handle the new size icons (24x24 [+ text]) that appeared with v5.60 (it's very long to do it by hand, while the form designer handles the 16x16 toolbar very well)

:wink:
User avatar
mk-soft
Always Here
Always Here
Posts: 5333
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Toolbar gadget in Form Designer

Post by mk-soft »

RobertSF wrote:I'm sorry, but while EventDesigner is impressive, it doesn't seem related to the issue I posted.

The issue is that you cannot really create forms with toolbars and status bars in Form Designer because they all wind up with the same ID. You have to manually edit the code, but those edits disappear when you reload the form in Form Designer, of course.
I know this and the EventDesigner corrects it by creating a new file.

Example:
Create two forms with the window constant FormMain (file FormMain.pbf) and one with the window constant FormDialog (file FormDialog.pbf).
Add these files to EventDesigner in the order FormMain and then FormDiaglog.
The result is a file 'commonfile.pb' with the appropriate constants. All gadgets, menus, etc get the constant of the window as prefix.
You don't need to take the event manager if you don't want to.
If the form changes, just call it up again.

P.S.
Some bugs found because PB v5.62
New Version Online EventDesigner v1.07
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
RobertSF
User
User
Posts: 61
Joined: Thu May 03, 2018 4:24 pm

Re: Toolbar gadget in Form Designer

Post by RobertSF »

Yes, I now see what you mean. I think I can use it in a different project, but for this simple one, I need large icons in the toolbar as well. Here is the workaround I came up with.

1.- Design the form with Form Designer as usual.
2.- Switch the form to code view and copy all the code.
3.- Paste the code exactly where you were going to use FileInclude to include the form file.
4.- Now tweak the form code where you pasted it.

If you ever need to change the form, change it with Form Designer and repeat steps 2, 3, and 4.
Post Reply