Path: utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!killer!texbell!tness1!sugar!peter From: peter@sugar.uu.net (Peter da Silva) Newsgroups: comp.sys.amiga Subject: Re: Standardization Keywords: Menus Message-ID: <2872@sugar.uu.net> Date: 20 Oct 88 23:48:40 GMT References: <1314@nmtsun.nmt.edu> Organization: Sugar Land Unix - Houston, TX Lines: 84 My comment is... you're too specific. Standard menus shouldn't, at least at this point, be specified any deeper than: Title: Jammed closely together, with anout 1.5 character positions between them. There's no need for extra space. Implementation: menu = AddMenu(menubar, newmenuname) Top level: Text, offset a little to make them look good when hilighted. Stacked vertically until the bottom of the screen, then continue on in even, even-height columns. Menu title should be jammed closely together... let the menus overlap, since they're not going to be displayed. Implementation: menuitem = Additem(menu, itemname) For grouping a half-character blank space will be left between groups: Implementation: menuitem = Addblank(menu, drawline); Drawline is true if a line will be drawn. This can be implemented as a short unselectable item (zero width, not ghosted, to avoid a dotted line). Next level: All checkmarked menus here. Offset to the right of the item they're attached to. Again, take them to the bottom of the screen then switch to multiple even, even-height columns. Implementation: subitem = Addsubitem(menuitem, subname, checked, mask); Checked is true if this is checked by default. Mask is a bitmask of other subitems in the same menu that are mutually exclusive. If none listed this will be a toggle. This will let you build fairly nice looking if bland menus. I use an even simpler version of this in Browser. I'll post that if you like, but I'm not going to implement the whole thing. Menus are easy. How do you define a standard for a scrolling list of text items? For an editable text pane? For a set of radio buttons? These are the sort of objects that need to be implemented. With a simple programmer interface... win = OpenWindow(...); wwin = NewWidgetWindow(win); /* build extended structure around win */ UseDefaultBorder(wwin); pane = AddTextPane(wwin, 2, 1, 40, 4); /* Add a 40 by 4 text pane, resize window to fit if necessary */ bar = AddRadioBar(wwin, 2, Below(pane)+1, 40, 1, "Bunch|Of|Button|Labels"); /* Add a radio bar below the pane, with a 1 scanline gap. The bar is 40 characters wide and one deep, and contains 4 buttons: BUNCH, Of, Button, and Labels. Resize window if necessary. */ Show(win); /* Window was created backdrop behind the workbench window. This brings it to the front and turns odd the backdrop flag. */ Wait(win->UserPort.mp_SigBits); while(widgetevent = GetWidgetEvent(wwin)) { if(widgetevent->widget == bar) { switch(bar->button) { ... } } ... RecycleWidgetEvent(widgetevent); } And so on. This would be way easier than the current setup. You wouldn't need to count scanlines or guess. You could create new widgets (they're supposed to be object-oriented, if you hadn't guessed)... Anyone up for comp.sys.amiga Project #n? -- Peter da Silva `-_-' peter@sugar.uu.net Have you hugged U your wolf today? Disclaimer: I accept full responsibility for my own typos.