Object *ScreenModeProperties__OM_NEW(Class *CLASS, Object *self, struct opSet *message) { struct ScreenModeProperties_DATA *data; Object *width, *height, *depth, *def_width, *def_height; Object *autoscroll; ULONG id; self = (Object *)DoSuperNewTags ( CLASS, self, NULL, MUIA_Group_Horiz, TRUE, Child, (IPTR)ColGroup(4), Child, (IPTR)Label1(__(MSG_WIDTH)), Child, HLeft(width = (Object *)NumericbuttonObject, End), Child, (IPTR)(def_width = (Object *)CheckMarkObject, End), Child, (IPTR)Label1(__(MSG_DEFAULT)), Child, (IPTR)Label1(__(MSG_HEIGHT)), Child, HLeft(height = (Object *)NumericbuttonObject, End), Child, (IPTR)(def_height = (Object *)CheckMarkObject, End), Child, (IPTR)Label1(__(MSG_DEFAULT)), Child, (IPTR)Label1(__(MSG_DEPTH)), Child, HLeft(depth = (Object *)NumericbuttonObject, End), Child, (IPTR)RectangleObject, End, Child, (IPTR)RectangleObject, End, End, Child, (IPTR)MUI_MakeObject(MUIO_VBar, 20), Child, (IPTR)HCenter(HGroup, Child, (IPTR)Label1(__(MSG_AUTOSCROLL)), Child, (IPTR)(autoscroll = (Object *)CheckMarkObject, End), End), TAG_MORE, (IPTR)message->ops_AttrList ); if (!self) goto err; data = INST_DATA(CLASS, self); data->width = width; data->height = height; data->depth = depth; data->def_width = def_width; data->def_height = def_height; data->autoscroll = autoscroll; DoMethod ( width, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime, (IPTR)self, 3, MUIM_Set, MUIA_ScreenModeProperties_Width, MUIV_TriggerValue ); DoMethod ( height, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime, (IPTR)self, 3, MUIM_Set, MUIA_ScreenModeProperties_Height, MUIV_TriggerValue ); DoMethod ( depth, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime, (IPTR)self, 3, MUIM_Set, MUIA_ScreenModeProperties_Depth, MUIV_TriggerValue ); DoMethod ( def_width, MUIM_Notify, MUIA_Selected, TRUE, (IPTR)width, 1, MUIM_Numeric_SetDefault ); DoMethod ( width, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime, (IPTR)def_width, 3, MUIM_Set, MUIA_Selected, FALSE ); DoMethod ( def_height, MUIM_Notify, MUIA_Selected, TRUE, (IPTR)height, 1, MUIM_Numeric_SetDefault ); DoMethod ( height, MUIM_Notify, MUIA_Numeric_Value, MUIV_EveryTime, (IPTR)def_height, 3, MUIM_Set, MUIA_Selected, FALSE ); id = GetTagData(MUIA_ScreenModeProperties_DisplayID, INVALID_ID, message->ops_AttrList); set(self, MUIA_ScreenModeProperties_DisplayID, id); return self; err: CoerceMethod(CLASS, self, OM_DISPOSE); return NULL; }
void main( void ) { int Done = FALSE; ULONG sig; static STRPTR styleoptions[] = { "IRC", "Email", "HTML", NULL }; if( !( MUIMasterBase = OpenLibrary( MUIMASTER_NAME, 19 ) ) ) return; if( app = ApplicationObject, MUIA_Application_Title, "TextInputDemo", MUIA_Application_Version, "$VER: TextInput Demo 2.0", MUIA_Application_Copyright, "© 1997-99 by Oliver Wagner, All Rights Reserved", MUIA_Application_Author, "Oliver Wagner", MUIA_Application_Description, "Demo for Textinput.mcc", MUIA_Application_Base, "TEXTINPUT-DEMO", SubWindow, win = WindowObject, MUIA_Window_ID, 42, MUIA_Window_Title, "TextInput Demo", WindowContents, VGroup, Child, HGroup, Child, Label1( "Style:" ), Child, Cycle( styleoptions ), End, Child, HGroup, GroupFrameT( "Single line" ), Child, ColGroup( 2 ), Child, Label2( "Input:" ), Child, ti1 = TextinputObject, StringFrame, MUIA_CycleChain, 1, MUIA_ControlChar, 'a', MUIA_Textinput_Multiline, FALSE, MUIA_Textinput_Contents, C1, End, Child, Label2( "NoInput:" ), Child, ti2 = TextinputObject, TextFrame, MUIA_Background, MUII_TextBack, MUIA_Textinput_NoInput, TRUE, MUIA_Textinput_Contents, C1, End, End, End, Child, VGroup, GroupFrameT( "Multi line with scroll" ), Child, timl1 = TextinputscrollObject, StringFrame, MUIA_CycleChain, 1, MUIA_ControlChar, 'b', MUIA_Textinput_Multiline, TRUE, MUIA_Textinput_Contents, C2, End, Child, bt_get = SimpleButton( "Get contents (to shell window)" ), End, Child, HGroup, GroupFrameT( "NoInput multi line with Scroll" ), Child, timl2 = TextinputscrollObject, TextFrame, MUIA_Background,MUII_TextBack,MUIA_CycleChain, 1, MUIA_ControlChar, 'c', MUIA_Textinput_NoInput, TRUE, MUIA_Textinput_Multiline, TRUE, MUIA_Textinput_AutoExpand, TRUE, MUIA_Textinput_Contents, C2, MUIA_Textinput_MinVersion, 12, MUIA_Textinput_WordWrap, 60, End, End, Child, HGroup, GroupFrameT( "Old stringgadget" ), Child, String( C1, 256 ), End, End, End, End ) { DoMethod( win, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit ); DoMethod( bt_get, MUIM_Notify, MUIA_Pressed, FALSE, app, 2, MUIM_Application_ReturnID, 2 ); DoMethod( ti1, MUIM_Notify, MUIA_String_Contents, MUIV_EveryTime, ti2, 3, MUIM_Set, MUIA_Text_Contents, MUIV_TriggerValue ); DoMethod( timl1, MUIM_Notify, MUIA_String_Contents, MUIV_EveryTime, timl2, 3, MUIM_Set, MUIA_Text_Contents, MUIV_TriggerValue ); DoMethod( ti1, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, ti1, 3, MUIM_Set, MUIA_Textinput_Contents, "" ); set( win, MUIA_Window_Open, TRUE ); while( !Done ) { LONG id; id = DoMethod( app, MUIM_Application_Input, &sig ); switch( id ) { case MUIV_Application_ReturnID_Quit: Done = TRUE; case 2: { char *p; get( timl1, MUIA_Textinput_Contents, &p ); PutStr( ">>>>>\n" ); PutStr( p ); PutStr( "<<<<<\n" ); } break; } if( sig ) if( Wait( sig | SIGBREAKF_CTRL_C ) & SIGBREAKF_CTRL_C ) Done = TRUE; } MUI_DisposeObject( app ); } CloseLibrary( MUIMasterBase ); }
int main(UNUSED int argc,char **argv) { int res; if ((IntuitionBase = (APTR)OpenLibrary("intuition.library",39)) != NULL && GETINTERFACE("main", IIntuition, IntuitionBase)) { if ((MUIMasterBase = OpenLibrary("muimaster.library",19)) != NULL && GETINTERFACE("main", IMUIMaster, MUIMasterBase)) { Object *app, *win, *sb, *appearance, *labelPos, *borderless, *sunny, *raised, *scaled, *update; if ((app = ApplicationObject, MUIA_Application_Title, "TheBar Demo4", MUIA_Application_Version, "$VER: TheBarDemo4 1.0 (24.6.2003)", MUIA_Application_Copyright, "Copyright 2003 by Alfonso Ranieri", MUIA_Application_Author, "Alfonso Ranieri <*****@*****.**>", MUIA_Application_Description, "TheBar example", MUIA_Application_Base, "THEBAREXAMPLE", MUIA_Application_UsedClasses, usedClasses, SubWindow, win = WindowObject, MUIA_Window_ID, MAKE_ID('M','A','I','N'), MUIA_Window_Title, "TheBar Demo4", WindowContents, VGroup, Child, sb = TheBarObject, MUIA_Group_Horiz, TRUE, MUIA_TheBar_IgnoreAppearance, TRUE, MUIA_TheBar_EnableKeys, TRUE, MUIA_TheBar_Buttons, buttons, MUIA_TheBar_StripBrush, &cbrush, MUIA_TheBar_StripCols, 16, MUIA_TheBar_StripRows, 3, MUIA_TheBar_StripHSpace, 0, MUIA_TheBar_StripVSpace, 0, End, Child, VGroup, GroupFrameT("Settings"), Child, HGroup, Child, Label2("Appearance"), Child, appearance = MUI_MakeObject(MUIO_Cycle,NULL,appearances), Child, Label2("Label pos"), Child, labelPos = MUI_MakeObject(MUIO_Cycle,NULL,labelPoss), End, Child, HGroup, Child, HSpace(0), Child, Label1("Borderless"), Child, borderless = MUI_MakeObject(MUIO_Checkmark,NULL), Child, HSpace(0), Child, Label1("Sunny"), Child, sunny = MUI_MakeObject(MUIO_Checkmark,NULL), Child, HSpace(0), Child, Label1("Raised"), Child, raised = MUI_MakeObject(MUIO_Checkmark,NULL), Child, HSpace(0), Child, Label1("Scaled"), Child, scaled = MUI_MakeObject(MUIO_Checkmark,NULL), Child, HSpace(0), End, End, Child, update = MUI_MakeObject(MUIO_Button,"_Update"), End, End, End) != NULL) { ULONG sigs = 0; LONG id; DoMethod(win,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,MUIV_Notify_Application,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit); DoMethod(update,MUIM_Notify,MUIA_Pressed,FALSE,app,2,MUIM_Application_ReturnID,TAG_USER); set(win,MUIA_Window_Open,TRUE); while ((id = DoMethod(app,MUIM_Application_NewInput,&sigs))!=MUIV_Application_ReturnID_Quit) { if (id==(LONG)TAG_USER) { IPTR appearanceV = 0, labelPosV = 0, borderlessV = 0, sunnyV = 0, raisedV = 0, scaledV = 0; get(appearance,MUIA_Cycle_Active,&appearanceV); get(labelPos,MUIA_Cycle_Active,&labelPosV); get(borderless,MUIA_Selected,&borderlessV); get(sunny,MUIA_Selected,&sunnyV); get(raised,MUIA_Selected,&raisedV); get(scaled,MUIA_Selected,&scaledV); SetAttrs(sb,MUIA_TheBar_ViewMode, appearanceV, MUIA_TheBar_LabelPos, labelPosV, MUIA_TheBar_Borderless, borderlessV, MUIA_TheBar_Sunny, sunnyV, MUIA_TheBar_Raised, raisedV, MUIA_TheBar_Scaled, scaledV, TAG_DONE); } if (sigs) { sigs = Wait(sigs | SIGBREAKF_CTRL_C); if (sigs & SIGBREAKF_CTRL_C) break; } } MUI_DisposeObject(app); res = RETURN_OK; } else { printf("%s: can't create application\n",argv[0]); res = RETURN_FAIL; } CLOSELIB(MUIMasterBase, IMUIMaster); } else { printf("%s: Can't open muimaster.library ver 19 or higher\n",argv[0]); res = RETURN_ERROR; } CLOSELIB(IntuitionBase, IIntuition); } else { printf("%s: Can't open intuition.library ver 39 or higher\n",argv[0]); res = RETURN_ERROR; } return res; }
Object *olabel1(ULONG id) { return Label1((ULONG)getString(id)); }