IPTR Popimage__OM_NEW(struct IClass *cl, Object *obj, struct opSet *msg) { struct Popimage_DATA *data; struct TagItem *tag, *tags; obj = (Object *) DoSuperNewTags ( cl, obj, NULL, ButtonFrame, InnerSpacing(4,4), MUIA_Background, MUII_ButtonBack, MUIA_InputMode, MUIV_InputMode_RelVerify, MUIA_Draggable, TRUE, TAG_MORE, (IPTR) msg->ops_AttrList ); if (!obj) return FALSE; data = INST_DATA(cl, obj); data->wintitle = NULL; data->adjust_type = MUIV_Imageadjust_Type_All; /* parse initial taglist */ for (tags = msg->ops_AttrList; (tag = NextTagItem((const struct TagItem**)&tags)); ) { switch (tag->ti_Tag) { case MUIA_Window_Title: data->wintitle = (CONST_STRPTR)tag->ti_Data; break; case MUIA_Imageadjust_Type: data->adjust_type = tag->ti_Data; break; } } DoMethod(obj, MUIM_Notify, MUIA_Pressed, FALSE, (IPTR)obj, 1, MUIM_Popimage_OpenWindow); return (IPTR)obj; }
STATIC VOID ProgressWindow_SubTask( STRPTR message ) { struct Library * MUIMasterBase; ENTER(); DBG_STRING(message); if((MUIMasterBase = OpenLibrary(MUIMASTER_NAME,MUIMASTER_VMIN))) { Object * app, * window; app = ApplicationObject, MUIA_Application_Title , "AmiNZB.WNDP", MUIA_Application_Base , "AmiNZB.WNDP", MUIA_Application_Version , ProgramVersionTag(), MUIA_Application_Description, ProgramDescription(), SubWindow, window = WindowObject, MUIA_Window_Borderless , TRUE, MUIA_Window_CloseGadget, FALSE, MUIA_Window_SizeGadget , FALSE, MUIA_Window_DepthGadget, FALSE, MUIA_Window_DragBar , FALSE, MUIA_Window_ScreenTitle, ProgramDescription(), WindowContents, VGroup, GroupFrameT(NULL), InnerSpacing(2,4), Child, TextObject, MUIA_Text_Contents, (ULONG)message, MUIA_Text_PreParse, "\033b\033c", MUIA_Font, MUIV_Font_Big, End, Child, BusyObject, End, End, End, End; if( app ) { DoMethod(window,MUIM_Notify,MUIA_Window_CloseRequest,TRUE, app,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit); set(window,MUIA_Window_Open,TRUE); if(xget( window, MUIA_Window_Open)) { ULONG sigs = 0; BOOL running = TRUE; struct Window * iWindow; if((iWindow = (struct Window *) xget( window, MUIA_Window_Window))) { ((struct Process *)FindTask(0))->pr_WindowPtr = iWindow; //SetWindowTitles( iWindow, NULL, ProgramDescription()); } do { switch(DoMethod(app,MUIM_Application_NewInput,&sigs)) { case MUIV_Application_ReturnID_Quit: //running = FALSE; DisplayBeep(NULL); break; default: break; } if(running && sigs) { sigs = Wait(sigs | SIGBREAKF_CTRL_C); if (sigs & SIGBREAKF_CTRL_C) break; } } while(running); set(window,MUIA_Window_Open,FALSE); } MUI_DisposeObject(app); } CloseLibrary(MUIMasterBase); } LEAVE(); }