T.R | Title | User | Personal Name | Date | Lines |
---|
1104.1 | The plot thickens . . . | ACESPS::WALTON | ZPG: a chance for the future | Mon Jul 17 1989 15:19 | 24 |
|
Well, since I haven't gotten a response I guess that there is no easy
way to get two pull down menus on the right side of a menu bar.
But. . .
We tried to skirt around the problem like this (by the way I'm asking
this for a ISV that I'm supporting):
We created an attached dialog box and gave it two menu bars as
children. The menu bars are attached so that the first one shows up on
the left and the second one follows on the right. This sort of gives
us the effect the ISV programmer wants.
But. . .
The menu bars won't resize! They are simply clipped when the main
window is resized. AARRRGG!
The Attached dialog box is set to DwtResizeShrinkWrap which I thought
meant that the box would grow when its children requested it.
Could someone help me , Please?
|
1104.2 | sorry for taking so long | KOBAL::SCAER | | Mon Jul 17 1989 19:05 | 5 |
|
There's a resource on a menubar for placing a menu on the right
side. Its called 'menu_help_widget' and it takes a menu as its
value.
|
1104.3 | Only good for one. | ACESPS::WALTON | ZPG: a chance for the future | Tue Jul 18 1989 10:30 | 10 |
|
Thanks for the suggestion but menu_help_widget is only good for one menu
entry. I would like to be able to have two or three entries right
justified.
I think using two menu bars in an attached dialog box would work fine
if I could get the dialog box to honor resize requests from the menu
bars.
Dave
|
1104.4 | A sample of ADB UIL code... | AITG::WILSON | | Tue Jul 18 1989 15:14 | 57 |
|
What kind of attachment constraints are you using ?
In the past I've created a popup attached dialog box where I attached
a menu bar to it and the menu bar appropriately resized with the dialog. Here's
a UIL code fragment:
object edutil_window : popup_attached_db {
arguments {
title = DX_K_EDUTIL_TITLE;
width = 500;
height = 300;
no_resize = false; /* provide a resize icon */
default_horizontal_offset = 10;
default_vertical_offset = 10;
};
controls {
menu_bar edutil_menu_bar;
label edutil_label;
simple_text edutil_text;
};
};
object edutil_menu_bar : menu_bar {
arguments {
orientation = DwtOrientationHorizontal;
spacing = 30; ! pixels between menu items
menu_help_widget = pulldown_entry edutil_help_entry;
adb_top_attachment = DwtAttachAdb;
adb_top_offset = 0;
adb_left_attachment = DwtAttachAdb;
adb_left_offset = 0;
adb_right_attachment = DwtAttachAdb;
adb_right_offset = 0;
};
controls {
pulldown_entry edutil_file_entry;
pulldown_entry edutil_edit_entry;
pulldown_entry edutil_execute_entry;
pulldown_entry edutil_help_entry;
};
};
In your case, where you want to keep the right side of the left
menu attached with the left side of the right menu (got that ? :-) ) perhaps
you could try something like DwtAttachPosition and specify the left/right
position of the menu bars' edges here. Just a suggestion off the top of
my head, I've never tried two menu bars at once.
|
1104.5 | I'll show you mine. . . | ACESPS::WALTON | ZPG: a chance for the future | Tue Jul 18 1989 16:17 | 73 |
|
Re: .4
I don't think its the attachments that are the problem. It sort of
seems that the problem is the attached dialog box, I see you are using
a popup attached dialog box.
Heres what my UIL looks like.
object
s_adbox : attached_dialog_box {
arguments {
resize = DwtResizeShrinkWrap;
width = 500;
height = 30;
};
controls {
menu_bar s_menu_bar;
menu_bar s_menu_bar2;
};
callbacks {
create = procedure create_proc (k_adbox);
};
};
object
s_menu_bar : menu_bar widget {
arguments {
adb_top_attachment = DwtAttachAdb;
adb_top_offset = 0;
adb_left_attachment = DwtAttachAdb;
adb_left_offset = 0;
orientation = DwtOrientationHorizontal;
spacing = 15; ! Pixels between items in menu
};
controls {
pulldown_entry file_menu_entry;
pulldown_entry edit_menu_entry;
pulldown_entry order_menu_entry;
};
callbacks {
create = procedure create_proc (k_menu_bar);
};
};
object
s_menu_bar2 : menu_bar widget {
arguments {
adb_top_attachment = DwtAttachAdb;
adb_top_offset = 0;
adb_left_attachment = DwtAttachWidget; !The important
adb_left_widget = menu_bar s_menu_bar; ! ones.
adb_left_offset = 10;
adb_right_attachment = DwtAttachAdb;
adb_right_offset = 0;
orientation = DwtOrientationHorizontal;
spacing = 15;
};
controls {
pulldown_entry daves_menu_entry;
};
callbacks {
create = procedure create_proc (k_menu_bar2);
};
};
|
1104.6 | Here's a sleazy idea... | GOSOX::RYAN | DECwindows Mail | Wed Jul 19 1989 08:08 | 8 |
| This probably won't work, I suspect that the menu bar insists on
pulldown menu entry children, but...
You could try creating a second menu bar with the menus you want
"right-justified", and setting *that* as the menu_help_widget...
Mike
|
1104.7 | I'm lost | ACESPS::WALTON | ZPG: a chance for the future | Wed Jul 19 1989 13:49 | 19 |
|
Okay, now I'm really confused.
I changed my attached dialog box to a popup attached dialog box just
like in reply 4. Then I had it use just one menu. It still won't
resize! Something is screwy.
I even added a label and a simple text widget to mke it look axactly
like the example. I knew this was grasping at straws but I thought I'd
try. It didn't help.
I must be missing something.
By the way, in answer to reply 6, you were right Mike it didn't work.
The menu bar widget will not accept anothe menubar as its child.
Dave
|
1104.8 | Popup ADB seems to do what you want | AITG::WILSON | | Wed Jul 19 1989 14:52 | 82 |
|
Re .7:
Could you explain what you mean when you say "it won't resize" ?
Simple question, but are you specifying "no_resize = false" as below so
that you get a resize control in your dialog ?
I really don't know what is causing you problems. I took your
idea from .4 and added it to my code. This got something reasonably close
to the behavior you want. I found that when I resized the dialog box,
one of the menu bars would resize with it while the other would remain fixed
in size, just large enough to enclose its pulldown entry children. I found
that the menu bar that resized was the one in which I specified the attachment
to the end of the other menu bar, so I reversed your order, specifying the end-
to-end constraint in the left menubar; this way, the right menu bar remains
fixed in size, keeping its items to the right relative to the dialog box as
you want.
What is it that you fetch from UIL ? Is it the attached dialog box
itself, or does it have a parent like a main window ? Perhaps parenting
it under a main window might help (just a guess here).
Here's my modified code:
object edutil_window : popup_attached_db {
arguments {
title = DX_K_EDUTIL_TITLE;
width = 500;
height = 300;
no_resize = false; /* provide a resize icon */
default_horizontal_offset = 10;
default_vertical_offset = 10;
};
controls {
menu_bar second_menu_bar; !! <<<- note the order !!!
menu_bar edutil_menu_bar;
label edutil_label;
simple_text edutil_text;
};
};
object edutil_menu_bar : menu_bar {
arguments {
orientation = DwtOrientationHorizontal;
spacing = 30; ! pixels between menu items
adb_top_attachment = DwtAttachAdb;
adb_top_offset = 0;
adb_left_attachment = DwtAttachAdb;
adb_left_offset = 0;
adb_right_attachment = DwtAttachWidget;
adb_right_widget = menu_bar second_menu_bar;
adb_right_offset = 10; !! per the code in .4 - why not 0 ?
};
controls {
pulldown_entry edutil_file_entry;
pulldown_entry edutil_edit_entry;
};
};
object second_menu_bar : menu_bar {
arguments {
orientation = DwtOrientationHorizontal;
spacing = 30; ! pixels between menu items
adb_top_attachment = DwtAttachAdb;
adb_top_offset = 0;
adb_right_attachment = DwtAttachAdb;
adb_right_offset = 0;
};
controls {
pulldown_entry edutil_execute_entry;
pulldown_entry edutil_help_entry;
};
};
|
1104.9 | | PSW::WINALSKI | Careful with that VAX, Eugene | Wed Jul 19 1989 15:47 | 7 |
| RE: .3
Two right-justified menu items isn't style guide conformant. You shouldn't be
doing this.
--PSW
|
1104.10 | What I mean is . | ACESPS::WALTON | ZPG: a chance for the future | Wed Jul 19 1989 16:01 | 14 |
| Re: .8
When I say "it wont resize" I mean that both the menu bars are clipped
horizontally if I resize the dialog box to be so skiny that all the
menu entries wont fit. What I want is for them to grow vertically as
I've seen them do on other applications.
The attached dialog box that I'm using doesn't have a parent, I'll try
it a parent.
Thanks for the help.
Dave
|
1104.11 | | LEOVAX::TREGGIARI | | Wed Jul 19 1989 17:15 | 8 |
| The main window widget is the only widget that knows how to properly deal
with a menu bar (i.e. make it wrap when it should, etc...). You should
create a popup shell, with a main window widget child, with the menu
bar as the child of that. As far as the two items on the right hand
side go, I can't think of anything that will do that for you.
Leo
|
1104.12 | You can't always get what you want | ACESPS::WALTON | ZPG: a chance for the future | Thu Jul 20 1989 16:15 | 10 |
|
Okay, So it looks like I can either use the dialog box with two
menu bars and live without the menu entry "wrapping." Or I can conform
to the style guide and be happy with just the help menu on the right.
Not the answer I was hoping for but at least its an answer.
Thanks for all the help!!!
Dave
|