cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

help! my button falls off the toolbar ledge

naglists
1-Newbie

help! my button falls off the toolbar ledge

Hi,

I am adding a button, two actually, one each to the end of the first and
second default toolbars. I have xuitoolbar.xml located in custom/dialogs.
The relevant x/y coordinates are: 470,0 (first toolbar) and 470,26 (second
toolbar).

This works as designed until an author resizes the Editor window to be
narrow enough to collide with the end of the toolbars. My buttons spill onto
the next line and (and this is the part that I'm trying to fix) do not pull
back onto their original bars when the window is re-resized large enough to
fit them.

For example, assuming each number is a button, I start with this:

12345678
123456

After a resizing (and a re-resizing), I'm stuck with this:
1234567
8
12345
6

I can't find the event, if there is one, and/or the command that will
reposition my buttons back where they belong. Am I missing something or is
this in fact not possible?

--
Paul Nagai
8 REPLIES 8

Does the Window menu - Default Window Configuration do anything?

Well, yeah, that restores the buttons to their proper location. Thanks, Ed.
I'll pass that back to the authors. It does have other consequences and must
be manually selected, but they may go for it.


Now chasing the menu command (WindowDefaultConfiguration) which is actually
an alias for window_reset_configuration() (set in ...\packages\commands.acl)
but am not finding window_reset_configuration() exposed anywhere.

Also, I still can't find a listener / event handler that fires on the
resizing of a window.



The window_reset_configuration() function appears to be a built-in
(there's documentation in the help for it).

If resetting the overall window configuration fixes the layout,
perhaps just turning the relevant toolbars off (set toolbarX=off) and
back on might do the same. Not sure how to trigger this technique, if
it works, as I also see no callbacks or hooks for when the window gets
resized. Nothing readily accessible in ACL, anyway.

-Brandon 🙂


Set toolbarX=off/on doesn't speak to "custom" toolbars (unless, possibly, if
you use toolbar5). However, I can hide/show by using:

dlgitem_hide(current_window(),"mybuttonid")
dlgitem_show(current_window(),"mybuttonid")

BUT the buttons disappear from and return in the same location. 😕

Ha! Got further, now. This removes the button:
dlgitem_remove_toolbar(current_window(),"mybuttonid"))

And this adds it back in the proper location:
window_load_component_file(current_window(),"mytoolbarxuifile.xml")

mytoolbarxuifile.xml is stored in custom/dialogs.

I can now at least make a menu pick / command key combination that will
restore the buttons.

If only I could capture an Editor resize.


On Tue, Dec 7, 2010 at 3:39 PM, Brandon Ibach <
brandon.ibach@single-sourcing.com> wrote:

> The window_reset_configuration() function appears to be a built-in
> (there's documentation in the help for it).
>
> If resetting the overall window configuration fixes the layout,
> perhaps just turning the relevant toolbars off (set toolbarX=off) and
> back on might do the same. Not sure how to trigger this technique, if
> it works, as I also see no callbacks or hooks for when the window gets
> resized. Nothing readily accessible in ACL, anyway.
>
> -Brandon 🙂
>
>
>

Not that I want to try this, but...

Surely there's a way in ACL to access the Windows functions/events? If so, there'll be a flag for the window resize, but it'll certainly involve accounting for a dozen unneeded chunks of information as well. That's why I wouldn't want to try it, but it could be possible.

Gotta Love Gates... 😄
Steve Thompson
+1(316)977-0515

I am having a similar problem since switching to 5.4. I have to add multiple toolbars using window_load_component_file and in 5.2 they would nicely stack vertically. I did not change the code to add them at all but in 5.4, they are being added at the horizontal end of a row even when there is not room for them and I can't get them to stack nicely. I will try to follow the good numerical code used earlier.

In 5.2,

Toolbar1

Toolbar2

In 5.4,

Toolbar1|Toolbar2

and half of Toolbar 2 is cut off.

I am adding my toolbars using a file, xuitoolbar.xml, located in
custom/dialogs. The relevant x/y coordinates are: 470,0 (first toolbar) and
470,26 (second toolbar). (Don't have the code in front of me, or I'd post it
all.)

How are you adding yours?

Is it possible the dimensions of the toolbars changed across upgrades and
your y values need to adjust?

I thought the pixel width of each icon was 16 ... that doesn't add up to the
26 I'm using, though. Maybe 26 is "close enough" so it falls onto the second
row of toolbar ... not sure. Anyhow, if you can post the code you're using
to place the toolbars, someone might be able to comment specifically.

I didn't know that you could specify x,y coordinates for toolbars, now that I have done so things look much better. Thanks for the tip! Version 5.4 must handle unspecified coordinates differently. My code for the window adding was (and still is):

set toolbar1=off;
set toolbar2=off;
set toolbar3=off;
set toolbar4=off;
set toolbar1=on;
set toolbar2=on;
window_load_component_file(current_window(), "DraftToolbar.xml");
window_load_component_file(current_window(), "DraftToolbar2.xml");

Top Tags