🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.windows.interviews
3 messages
3 total messages Started by amy m wong Tue, 05 Jan 1993 18:55
Menubars and FieldEditors
#1610
Author: amy m wong
Date: Tue, 05 Jan 1993 18:55
78 lines
2750 bytes
I've been struggling with two problems that I can't resolve.

1) I have a simple question about appending MenuItem objects
to menubars.  I want to know how to append a menu item to
the far right of a menubar.  It seems that Menu automatically
sticks a hglue() at the end of  a given menubar.  Thus, the 
last menu item can never be right justified. 

It should simple to do, but nothing seems to do the trick.
Beside generating a whole new derived class, there must
be an easier way.


2) I'm also having problems with the FieldEditor.  I noticed that
a previous posting mentioned this problem, but I never found the
solution.  Below is a reprint of the problem.


; Article 4094 of comp.windows.interviews:
; Subject: 3.1B FieldEditors
;
; I need some help with FieldEditor.
;
;I am using version 3.1 Beta of InterViews.  I'm trying to create a popup
;containing a FieldEditor and have the FieldEditor receive all keyboard
;events as long as the mouse is within the popup.  A sample of my code is:
;
;void
;Sample::CreatePopup()
;{
;    WidgetKit* kit = WidgetKit::instance();
;    Style* style = new Style(kit-;style());
;    style-;attribute("name", "sample");
;    LayoutKit* layout = LayoutKit::instance();
;    DialogKit* dialog = DialogKit::instance();
;    FieldEditor* ed = dialog-;field_editor(String("Sample Entry"), style);
;    InputHandler* h = new InputHandler(
;	kit-;inset_frame(
;	    layout-;margin(
;		layout-;hbox(
;	    	    layout-;vcenter(kit-;label("Label: ")),
;		    layout-;vcenter(ed)
;		),
;		20, 20
;	    )
;	),
;	style
;    );
;    h-;append_input_handler(ed);
;    h-;focus(ed);
;    window = new ApplicationWindow(h);
;    window-;style(style);
;    window-;map();
;}
;
;This creates the popup with the field editor but the editor only accepts
;keyboard input while the mouse pointer is on the editor itself or the label.
;It does not accept input if the mouse is in the margin around the label/editor
;box.
;
;Am I missing something?  The field editors in doc seem to work correctly and
;I modeled this code after doc's dialogs.c file.  Any suggestions would be
;appreciated!



By the way, I'm currently using Version 3.0.1 (if that helps any).


Thanks.




;---------------------------------------------------------------------------<
Ben Dai						byd999@unagi.measurex.com
Measurex Corporation
Cupertino, CA
Re: Menubars and FieldEditors
#1611
Author: Mark Linton
Date: Tue, 05 Jan 1993 21:49
23 lines
1474 bytes
In article <810@mesrx.UUCP>, amw116@mesrx.com (amy m wong) writes:
|> 1) I have a simple question about appending MenuItem objects
|> to menubars.  I want to know how to append a menu item to
|> the far right of a menubar.  It seems that Menu automatically
|> sticks a hglue() at the end of  a given menubar.  Thus, the 
|> last menu item can never be right justified. 

Put a menu item containing a piece of hglue(fil, 0, fil) before the right-adjusted items.
By making the natural size infinite, you force the box to shrink this glue
instead of stretching the glue at the end of the menu bar.

|> 2) I'm also having problems with the FieldEditor.  I noticed that
|> a previous posting mentioned this problem, but I never found the
|> solution.  Below is a reprint of the problem.

The problem is that picks go through the margins and frames.
Try putting a primitive target behind the dialog to catch all picks,
e.g.,

    layout->back(
        kit->inset_frame(...),
        new Target(nil, TargetPrimitiveHit)
    )
Re: Menubars and FieldEditors
#1631
Author: amy m wong
Date: Thu, 07 Jan 1993 02:16
55 lines
2433 bytes
With help and a little bit of work, I finally implemented
the right justified menu items.  For some reason, 
appending a blank menu item with a hglue(fil,0,fil) caused
my program to crash while trying to display it.  I fixed
this problem by using hglue(9.0E6,0,9.0E6).  I guess menu
append has problems with fil (ie. 10.0E6).  To prevent the
menubar from filling the screen, I used layout->h_natural_span
to set the natural size of the menubar. 


Unfortunately, I still can't resolve my problem
with the Field Editors.  To refresh your memory, the
following is an excerpt of the response:

|> 2) I'm also having problems with the FieldEditor.  I noticed that
|> a previous posting mentioned this problem, but I never found the
|> solution.  Below is a reprint of the problem.

>The problem is that picks go through the margins and frames.
>Try putting a primitive target behind the dialog to catch all picks,
>e.g.,
>
>    layout->back(
>        kit->inset_frame(...),
>        new Target(nil, TargetPrimitiveHit)
>    )


Now, when trying to implement the targeting scheme, I received
compiler errors.  "back" is not a member function of LayoutKit.
Scanning the other member functions available in LayoutKit, I 
tried using "overlay".  So instead of using "layout->back", I used
"layout->overlay".  I included the glyph I wanted into the
"inset_frame" parameter.  I then included the whole thing in 
a box.  It of course compiled, but didn't solve my problem.  The 
FieldEditor is still only live when the arrow is within the editor 
itself.  I'm pretty sure that I must be interpretting something
wrong.  I have one idea of deriving a new class from FieldEditor,
but it's not pretty.

By the way, I'm currently using IV3.1 Beta 2 on ULTRIX with the Xlib
from DEC (if that helps any).



Thanks.




|=================================================================|
|Ben Dai				byd999@unagi.measurex.com |
|Measurex Corporation						  |
|Cupertino, CA							  |
|=================================================================|
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads