void ShowHelpDialog(BOOL about) { int a = about ? 1 : 0; if(HelpWindowOpen[a]) { SetForegroundWindow(HelpDialog[a]); return; } MakeClass(); char *s = about ? "About LDmicro" : "LDmicro Help"; HelpDialog[a] = CreateWindowEx(0, "LDmicroHelp", s, WS_OVERLAPPED | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_SIZEBOX, 100, 100, 650, 300+10*FONT_HEIGHT, NULL, NULL, Instance, NULL); MakeControls(a); ShowWindow(HelpDialog[a], TRUE); SetFocus(RichEdit[a]); HelpWindowOpen[a] = TRUE; RECT r; GetClientRect(HelpDialog[a], &r); TitleHeight = 300 - r.bottom; GetWindowRect(HelpDialog[a], &r); Resizing(&r, WMSZ_TOP); SetWindowPos(HelpDialog[a], HWND_TOP, r.left, r.top, r.right - r.left, r.bottom - r.top, 0); }
Class *CreateAmigaGuideClass(struct gtbApplication *appl) { Class *cl=NULL; if(cl = MakeClass (NULL, ROOTCLASS, NULL, sizeof(struct AGUIData), 0L)) { cl->cl_Dispatcher.h_Entry = (HookFunction) AGUI_Dispatcher; cl->cl_UserData = (ULONG) appl; return cl; } return(NULL); }
Class *MakeStringClass( void ) { Class *cl; cl = MakeClass( NULL, NULL, STRING_GetClass(), sizeof(struct myStringClassData), 0 ); if ( cl ) { cl->cl_Dispatcher.h_Entry = (uint32(*)())myStringClassDispatcher; } URLHistory_Init(); return( cl ); }
Class *MakeTimerClass() { #if (HASHED_STRINGS) struct MethodDescr mdescr[] = { { (IPTR (*)())_Timer_Start, M_Timer_Start }, { (IPTR (*)())_Timer_Stop, M_Timer_Stop }, { (IPTR (*)())_Timer_PrintElapsed, M_Timer_PrintElapsed }, { (IPTR (*)())_Timer_TestMethod, M_Timer_TestMethod }, }; struct InterfaceDescr ifdescr[]= { { mdescr, "Timer", 4}, { NULL, 0UL, 0UL} }; #endif #if (HASHED_IFS || HASHED_METHODS) IPTR (*methods[])() = { (IPTR (*)())_Timer_Start, (IPTR (*)())_Timer_Stop, (IPTR (*)())_Timer_PrintElapsed, (IPTR (*)())_Timer_TestMethod, }; struct InterfaceDescr ifdescr[] = { { methods, I_Timer, 4}, { NULL, 0UL, 0UL} }; #endif Class *cl; cl = MakeClass(TIMERCLASS, ROOTCLASS, ifdescr, sizeof (struct TimerData)); if (cl) { AddClass(cl); } return (cl); }
/* * Given the index in builtin classes, construct the * class and make it public (because of the fake lib base). */ static Class * builtin_to_public_class(ULONG idx) { const struct __MUIBuiltinClass *desc = builtins[idx]; Class *cl; Class *super; super = MUI_GetClass(desc->supername); if (!super) return NULL; cl = MakeClass(desc->name, NULL, super, desc->datasize, 0); if (!cl) return NULL; cl->cl_Dispatcher.h_Entry = desc->dispatcher; AddClass(cl); return cl; }
BOOL InitCoolImageClass(struct Library *CyberGfxBase) { BOOL retval = FALSE; cool_cybergfxbase = CyberGfxBase; if (IntuitionBase && GfxBase && UtilityBase) // && SysBase) { if (!cool_imageclass) { cool_imageclass = MakeClass(NULL, IMAGECLASS, NULL, sizeof(struct CoolImageData), 0UL); } if (cool_imageclass) { cool_imageclass->cl_Dispatcher.h_Entry = (HOOKFUNC)cool_imageclass_dispatcher; retval = TRUE; } } return retval; }