Fix all the other LM_ADD(REMOVE)CHILD calls to work on OS3

This commit is contained in:
Chris Young 2015-01-30 00:25:54 +00:00
parent 84700f1d9c
commit ed99a5c740

View File

@ -1534,7 +1534,8 @@ static bool ami_gui_hscroll_add(struct gui_window_2 *gwin)
IDoMethod(gwin->objects[GID_HSCROLLLAYOUT], LM_ADDCHILD,
gwin->win, gwin->objects[GID_HSCROLL], attrs);
#else
SetAttrs(gwin->objects[GID_HSCROLLLAYOUT], LAYOUT_AddChild, gwin->objects[GID_HSCROLL]);
SetAttrs(gwin->objects[GID_HSCROLLLAYOUT],
LAYOUT_AddChild, gwin->objects[GID_HSCROLL], TAG_MORE, &attrs);
#endif
return true;
}
@ -1578,7 +1579,8 @@ static bool ami_gui_vscroll_add(struct gui_window_2 *gwin)
IDoMethod(gwin->objects[GID_VSCROLLLAYOUT], LM_ADDCHILD,
gwin->win, gwin->objects[GID_VSCROLL], attrs);
#else
SetAttrs(gwin->objects[GID_VSCROLLLAYOUT], LAYOUT_AddChild, gwin->objects[GID_VSCROLL]);
SetAttrs(gwin->objects[GID_VSCROLLLAYOUT],
LAYOUT_AddChild, gwin->objects[GID_VSCROLL], TAG_MORE, &attrs);
#endif
return true;
}
@ -3171,13 +3173,20 @@ static void ami_gui_hotlist_toolbar_add(struct gui_window_2 *gwin)
BevelObj,
BEVEL_Style, BVS_SBAR_VERT,
BevelEnd;
#ifdef __amigaos4__
IDoMethod(gwin->objects[GID_HOTLISTLAYOUT], LM_ADDCHILD,
gwin->win, gwin->objects[GID_HOTLIST], attrs);
IDoMethod(gwin->objects[GID_HOTLISTLAYOUT], LM_ADDIMAGE,
gwin->win, gwin->objects[GID_HOTLISTSEPBAR], NULL);
#else
SetAttrs(gwin->objects[GID_HOTLISTLAYOUT],
LAYOUT_AddChild, gwin->objects[GID_HOTLIST], TAG_MORE, &attrs);
SetAttrs(gwin->objects[GID_HOTLISTLAYOUT],
LAYOUT_AddChild, gwin->objects[GID_HOTLISTSEPBAR], TAG_DONE);
#endif
FlushLayoutDomainCache((struct Gadget *)gwin->objects[GID_MAIN]);
RethinkLayout((struct Gadget *)gwin->objects[GID_MAIN],
@ -3223,14 +3232,16 @@ static void ami_gui_hotlist_toolbar_remove(struct gui_window_2 *gwin)
IDoMethod(gwin->objects[GID_HOTLISTLAYOUT], LM_REMOVECHILD,
gwin->win, gwin->objects[GID_HOTLISTSEPBAR]);
#else
SetAttrs(gwin->objects[GID_HOTLISTLAYOUT], LAYOUT_RemoveChild, gwin->objects[GID_HOTLIST]);
SetAttrs(gwin->objects[GID_HOTLISTLAYOUT], LAYOUT_RemoveChild, gwin->objects[GID_HOTLISTSEPBAR]);
#endif
FlushLayoutDomainCache((struct Gadget *)gwin->objects[GID_MAIN]);
RethinkLayout((struct Gadget *)gwin->objects[GID_MAIN],
gwin->win, NULL, TRUE);
ami_schedule_redraw(gwin, true);
#endif
}
static void ami_gui_hotlist_toolbar_update(struct gui_window_2 *gwin)
@ -3287,9 +3298,7 @@ static void ami_toggletabbar(struct gui_window_2 *gwin, bool show)
{
if(ClickTabBase->lib_Version < 53) return;
#ifdef __amigaos4__
if(show)
{
if(show) {
struct TagItem attrs[3];
attrs[0].ti_Tag = CHILD_WeightedWidth;
@ -3316,20 +3325,31 @@ static void ami_toggletabbar(struct gui_window_2 *gwin, bool show)
GA_Text, "+",
BUTTON_RenderImage, gwin->objects[GID_ADDTAB_BM],
ButtonEnd;
#ifdef __amigaos4__
IDoMethod(gwin->objects[GID_TABLAYOUT], LM_ADDCHILD,
gwin->win, gwin->objects[GID_TABS], NULL);
IDoMethod(gwin->objects[GID_TABLAYOUT], LM_ADDCHILD,
gwin->win, gwin->objects[GID_ADDTAB], attrs);
}
else
{
#else
SetAttrs(gwin->objects[GID_TABLAYOUT],
LAYOUT_AddChild, gwin->objects[GID_TABS], TAG_DONE);
SetAttrs(gwin->objects[GID_TABLAYOUT],
LAYOUT_AddChild, gwin->objects[GID_ADDTAB], TAG_MORE, &attrs);
#endif
} else {
#ifdef __amigaos4__
IDoMethod(gwin->objects[GID_TABLAYOUT], LM_REMOVECHILD,
gwin->win, gwin->objects[GID_TABS]);
IDoMethod(gwin->objects[GID_TABLAYOUT], LM_REMOVECHILD,
gwin->win, gwin->objects[GID_ADDTAB]);
#else
SetAttrs(gwin->objects[GID_TABLAYOUT],
LAYOUT_RemoveChild, gwin->objects[GID_TABS], TAG_DONE);
SetAttrs(gwin->objects[GID_TABLAYOUT],
LAYOUT_RemoveChild, gwin->objects[GID_ADDTAB], TAG_DONE);
#endif
gwin->objects[GID_TABS] = NULL;
gwin->objects[GID_ADDTAB] = NULL;
@ -3341,7 +3361,6 @@ static void ami_toggletabbar(struct gui_window_2 *gwin, bool show)
gwin->win, NULL, TRUE);
if(gwin->gw && gwin->gw->bw) browser_window_update(gwin->gw->bw, false);
#endif
}
void ami_gui_tabs_toggle_all(void)
@ -4919,6 +4938,8 @@ static nserror gui_search_web_provider_update(const char *provider_name,
bm = ami_bitmap_get_native(ico_bitmap, 16, 16, NULL);
}
if(bm == NULL) return NSERROR_BAD_PARAMETER;
node = (struct nsObject *)GetHead((struct List *)window_list);
do {
@ -5214,7 +5235,7 @@ Object *ami_gui_splash_open(void)
SetRPAttrs(win->RPort, RPTAG_APenColor, 0xFF3F6DFE, TAG_DONE);
tattr.ta_Name = "DejaVu Serif Italic.font";
#else
SetAPen(win->RPort, 3);
SetAPen(win->RPort, 3); /* Pen 3 is usually blue */
tattr.ta_Name = "CGTriumvirate.font";
#endif
tattr.ta_YSize = 24;