Пример #1
0
int main(void)
{
    Object *wnd;
    
    MUIMasterBase = (struct Library*)OpenLibrary("muimaster.library",0);

    app = ApplicationObject,
   	SubWindow, wnd = WindowObject,
    	    MUIA_Window_Title, "poplist",
	    MUIA_Window_Activate, TRUE,

    	    WindowContents, VGroup,
    	    	Child, PopscreenObject,
		    MUIA_Popstring_String, StringObject, StringFrame, End,
		    MUIA_Popstring_Button, PopButton(MUII_PopUp),
		    End,
		End,
	    End,
	End;

    if (app)
    {
	ULONG sigs = 0;

	DoMethod
        (
            wnd, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, (IPTR) app, 
            2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit
        );
	
	set(wnd,MUIA_Window_Open,TRUE);

	while (DoMethod(app, MUIM_Application_NewInput, (IPTR) &sigs) != MUIV_Application_ReturnID_Quit)
	{
	    if (sigs)
	    {
		sigs = Wait(sigs | SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D);
		if (sigs & SIGBREAKF_CTRL_C) break;
		if (sigs & SIGBREAKF_CTRL_D) break;
	    }
	}

	MUI_DisposeObject(app);
    }

    CloseLibrary(MUIMasterBase);
    
    return 0;
}
Пример #2
0
Object * PopaslObj( STRPTR Contents, STRPTR ASLText, BOOL drawers, ULONG ObjectID)
{
	return PopaslObject,
		MUIA_Popstring_String, StringObject, StringFrame,
			MUIA_CycleChain			, TRUE,
			MUIA_String_AdvanceOnCR		, TRUE,
			MUIA_String_MaxLen		, 1024,
			MUIA_String_Contents		, Contents,
			MUIA_ObjectID			, ObjectID,
		End,
		MUIA_Popstring_Button, PopButton(drawers ? MUII_PopDrawer : MUII_PopFile),
		ASLFR_TitleText, ASLText,
		ASLFR_DrawersOnly, drawers,
	End;
}
Пример #3
0
STATIC APTR MakeAsl(LONG str_id, ULONG id)
{
	APTR obj, pop;

	pop = PopButton(MUII_PopDrawer);

	obj = PopaslObject,
		ASLFR_DrawersOnly, TRUE,
		ASLFR_InitialShowVolumes, TRUE,
		MUIA_Popstring_Button, (IPTR)pop,
		MUIA_Popstring_String, (IPTR)MakeString(str_id, 1024, id),
		MUIA_Popasl_Type, ASL_FileRequest,
		End;

	if (obj)
		set(pop, MUIA_CycleChain, 1);

	return obj;
}
Пример #4
0
Object *CreatePrefs(struct Toolbar_DataP *data)
{
  Object **objs = data->Gadgets;
  Object *textgroup, *imagegroup;
  Object *prefsgroup;

  static STRPTR LookStrings[4];
  static STRPTR BorderTypeStrings[4];
  static STRPTR SelectionModeStrings[4];
  static STRPTR PrecisionStrings[5];
  static STRPTR GhostEffectStrings[5];

  BorderTypeStrings[0] = LOCALE(MSG_BORDERTYPE_OLD, "Old");
  BorderTypeStrings[1] = LOCALE(MSG_BORDERTYPE_OFF, "Off");
  BorderTypeStrings[2] = LOCALE(MSG_BORDERTYPE_NEW,  "New");
  BorderTypeStrings[3] = NULL;

  SelectionModeStrings[0] = LOCALE(MSG_SELECTIONMODE_OLD, "Old");
  SelectionModeStrings[1] = LOCALE(MSG_SELECTIONMODE_OFF, "Off");
  SelectionModeStrings[2] = LOCALE(MSG_SELECTIONMODE_NEW,  "New");
  SelectionModeStrings[3] = NULL;

  LookStrings[0] = LOCALE(MSG_IMAGETEXT, "Image and Text");
  LookStrings[1] = LOCALE(MSG_IMAGEONLY, "Image only");
  LookStrings[2] = LOCALE(MSG_TEXTONLY,  "Text only");
  LookStrings[3] = NULL;

  PrecisionStrings[0] = LOCALE(MSG_EXACT, "Exact");
  PrecisionStrings[1] = LOCALE(MSG_IMAGE, "Image");
  PrecisionStrings[2] = LOCALE(MSG_ICON,  "Icon");
  PrecisionStrings[3] = LOCALE(MSG_GUI,   "GUI");
  PrecisionStrings[4] = NULL;

//  GhostEffectStrings[0] = LOCALE(MSG_DIMMMED,     "Dimmed"); // Temporarily disabled - remember +-1
  GhostEffectStrings[0] = LOCALE(MSG_LIGHT,       "Light Grid");
  GhostEffectStrings[1] = LOCALE(MSG_HEAVY,       "Heavy Grid");
  GhostEffectStrings[2] = LOCALE(MSG_SUPERLIGHT,  "Superlight Grid");
  GhostEffectStrings[3] = NULL;

  prefsgroup =
    VGroup,
      Child, VGroup,
        Child, HGroup,
//        MUIA_Group_SameWidth, TRUE,
/*********************************  General  *********************************/
          Child, HGroup,
            MUIA_Background, MUII_GroupBack,
            MUIA_Frame     , MUIV_Frame_Group,
            MUIA_FrameTitle, LOCALE(MSG_GENERAL, "General"),
            Child, RectangleObject, End,
            Child, VGroup,
              Child, RectangleObject, End,
              Child, objs[Look] = RadioObject,
  //                MUIA_FrameTitle, "Toolbar look",
                MUIA_Radio_Entries, LookStrings,
              End,
              Child, RectangleObject, End,
            End,
  //ghosttype
            Child, RectangleObject, End,
          End,

/*********************************  Image  *********************************/
          Child, imagegroup = HGroup,
            MUIA_Background, MUII_GroupBack,
            MUIA_Frame     , MUIV_Frame_Group,
            MUIA_FrameTitle, LOCALE(MSG_IMAGE, "Image"),
            Child, RectangleObject, End,
            Child, VGroup,
              Child, RectangleObject, End,
              Child, HGroup,
                Child, RectangleObject, End,
                Child, VGroup,
                  Child, Label(LOCALE(MSG_USEIMAGES1, "\33cUse ghosted/selected images")),
//                  Child, MUI_MakeObject(MUIO_Label, LOCALE(MSG_USEIMAGES2, "\33c(if they are available)"), MUIO_Label_Tiny),
                  Child, TextObject,
                    MUIA_Text_Contents, LOCALE(MSG_USEIMAGES2, "\33c(if they are available)"),
                    MUIA_Font, MUIV_Font_Tiny,
                  End,
                End,
                Child, objs[UseImages] = CheckMark(TRUE),
//                Child, RectangleObject, End,
              End,
              Child, ColGroup(2),
//              Child, HGroup,
                Child, Label(LOCALE(MSG_REMAP, "Remap Precision")),
                Child, objs[Precision] = Cycle(PrecisionStrings),
//              End,
//              Child, HGroup,
                Child, Label(LOCALE(MSG_GHOSTEFFECT, "Ghosting effect")),
                Child, objs[GhostEffect] = Cycle(GhostEffectStrings),
//              End,
              End,

              Child, RectangleObject, End,
            End,
            Child, RectangleObject, End,
          End,
        End,

/*********************************  Spacing  *********************************/
        Child, HGroup,
          Child, HGroup,
            MUIA_Background, MUII_GroupBack,
            MUIA_Frame     , MUIV_Frame_Group,
            MUIA_FrameTitle, LOCALE(MSG_SPACING, "Spacing"),
            Child, VGroup,
              Child, RectangleObject, End,
              Child, ColGroup(2),
                Child, Label(LOCALE(MSG_GROUPSPACE, "Group Space")),
                Child, objs[GroupSpace] = SliderObject,
                  MUIA_Slider_Min,   -1,
                  MUIA_Slider_Max,   50,
                End,
                Child, Label(LOCALE(MSG_TOOLSPACE, "Tool Space")),
                Child, objs[ToolSpace] = SliderObject,
                  MUIA_Slider_Min,   -1,
                  MUIA_Slider_Max,   10,
                End,
                Child, VGroup,
                  Child, Label(LOCALE(MSG_INNERSPACE, "\33cInner Space")),
//                  Child, MUI_MakeObject(MUIO_Label,LOCALE(MSG_INNERSPACE_WITH, "\33c(with tooltext)"), MUIO_Label_Tiny),
                  Child, TextObject,
                    MUIA_Text_Contents, LOCALE(MSG_INNERSPACE_WITH, "\33c(with tooltext)"),
                    MUIA_Font, MUIV_Font_Tiny,
                  End,
                End,
                Child, objs[InnerSpace_Text] = SliderObject,
                  MUIA_Slider_Min,   0,
                  MUIA_Slider_Max,   10,
                End,
                Child, VGroup,
                  Child, Label(LOCALE(MSG_INNERSPACE, "\33cInner Space")),
//                  Child, MUI_MakeObject(MUIO_Label,LOCALE(MSG_INNERSPACE_WITHOUT, "\33c(without tooltext)"), MUIO_Label_Tiny),
                  Child, TextObject,
                    MUIA_Text_Contents, LOCALE(MSG_INNERSPACE_WITHOUT, "\33c(without tooltext)"),
                    MUIA_Font, MUIV_Font_Tiny,
                  End,
                End,
                Child, objs[InnerSpace_NoText] = SliderObject,
                  MUIA_Slider_Min,   0,
                  MUIA_Slider_Max,   10,
                  MUIA_Disabled, TRUE,
                End,
  // some kind of relative mode
  // width: fixed/floating
              End,
              Child, RectangleObject, End,
            End,
          End,

  /*********************************  Text  *********************************/
          Child, textgroup = HGroup,
            MUIA_Background, MUII_GroupBack,
            MUIA_Frame     , MUIV_Frame_Group,
            MUIA_FrameTitle, LOCALE(MSG_TEXT, "Text"),
            Child, VGroup,
              Child, RectangleObject, End,
/*              Child, HGroup,
                Child, RectangleObject, End,
                Child, Label(LOCALE(MSG_PLACEMENT, "Placement")),
                Child, data->CY_Placement = Cycle(CY_textplacement),
//                Child, RectangleObject, End,
              End,
*/              Child, ColGroup(2),
//                Child, VGroup,
                  Child, Label(LOCALE(MSG_COLOR, "Text Color")),
//                End,
//                Child, VGroup,
                  Child, objs[ToolPen] = PoppenObject,
                    MUIA_Window_Title, LOCALE(MSG_ADJUST, "Adjust Text Color"),
                    MUIA_Draggable, TRUE,
                    MUIA_ShortHelp, LOCALE(MSG_COLOR_HELP, "Color of the tool texts."),
                  End,
                  Child, Label2(LOCALE(MSG_FONT, "Text Font")),
                  Child, data->FontASL = PopaslObject,
                    MUIA_Popstring_String, objs[ToolFont] = String(0,35),
                    MUIA_Popstring_Button, PopButton(MUII_PopUp),
                    MUIA_Popasl_Type , ASL_FontRequest,
                    ASLFO_TitleText  , LOCALE(MSG_SELECT, "Please select a text font..."),
                  End,
//                End,
              End,
              Child, RectangleObject, End,
            End,
          End,
        End,
// Sløringseffekt: Normal, 3D, ...
  End,
/*
      Child, HGroup,
        Child, HGroup,
          MUIA_Background, MUII_GroupBack,
          MUIA_Frame     , MUIV_Frame_Group,
          MUIA_FrameTitle, LOCALE(MSG_BORDERTYPE, "Border Type"),
          InnerSpacing(12, 12),
          Child, objs[BorderType] = Cycle(BorderTypeStrings),
        End,
        Child, VGroup,
          MUIA_Background, MUII_GroupBack,
          MUIA_Frame     , MUIV_Frame_Group,
          MUIA_FrameTitle, LOCALE(MSG_SELECTIONMODE, "Selection Border"),
          InnerSpacing(12, 12),
          Child, objs[SelectionMode] = Cycle(SelectionModeStrings),
          Child, HGroup,
            Child, Label2(LOCALE(MSG_AUTOACTIVE, "Show Active on Mousehi")),
            Child, objs[AutoActive] = CheckMark(TRUE),
          End,
        End,
      End,
*/



        Child, HGroup,


          Child, HGroup,
            MUIA_Background, MUII_GroupBack,
            MUIA_Frame     , MUIV_Frame_Group,
            MUIA_FrameTitle, LOCALE(MSG_BORDERTYPE, "Border Type"),
            Child, RectangleObject, End,
            Child, VGroup,
              Child, RectangleObject, End,
              Child, objs[BorderType] = Cycle(BorderTypeStrings),
              Child, RectangleObject, End,
            End,
            Child, RectangleObject, End,
          End,

          Child, HGroup,
            MUIA_Background, MUII_GroupBack,
            MUIA_Frame     , MUIV_Frame_Group,
            MUIA_FrameTitle, LOCALE(MSG_SELECTIONMODE, "Selection Border"),
            Child, RectangleObject, End,
            Child, VGroup,
              Child, RectangleObject, End,
              MUIA_Weight, 200,
              Child, objs[SelectionMode] = Cycle(SelectionModeStrings),
              Child, HGroup,
                Child, Label2(LOCALE(MSG_AUTOACTIVE, "Show Active on Mousehit")),
                Child, objs[AutoActive] = CheckMark(TRUE),
              End,            
              Child, RectangleObject, End,
            End,
            Child, RectangleObject, End,
          End,


        End,


      Child, TextObject,
        TextFrame,
        MUIA_Background, MUII_TextBack,
        MUIA_FixHeightTxt, "\n\n",
        MUIA_Text_Contents, ABOUTTEXT,
      End,
    End;

  if(prefsgroup)
  {
    DoMethod(objs[Look], MUIM_Notify, MUIA_Radio_Active, 0, textgroup, 6, MUIM_MultiSet, MUIA_Disabled, FALSE, textgroup, imagegroup, objs[InnerSpace_Text]);
    DoMethod(objs[Look], MUIM_Notify, MUIA_Radio_Active, 1, textgroup, 5, MUIM_MultiSet, MUIA_Disabled, TRUE, textgroup, objs[InnerSpace_Text]);
    DoMethod(objs[Look], MUIM_Notify, MUIA_Radio_Active, 2, textgroup, 5, MUIM_MultiSet, MUIA_Disabled, FALSE, textgroup, objs[InnerSpace_Text]);

    DoMethod(objs[Look], MUIM_Notify, MUIA_Radio_Active, 0, objs[InnerSpace_NoText], 3, MUIM_Set, MUIA_Disabled, TRUE);
    DoMethod(objs[Look], MUIM_Notify, MUIA_Radio_Active, 1, imagegroup, 5, MUIM_MultiSet, MUIA_Disabled, FALSE, imagegroup, objs[InnerSpace_NoText]);
    DoMethod(objs[Look], MUIM_Notify, MUIA_Radio_Active, 2, imagegroup, 5, MUIM_MultiSet, MUIA_Disabled, TRUE, imagegroup, objs[InnerSpace_NoText]);
  }

  return prefsgroup;
}
Пример #5
0
/**
 * Initialize the filter window.
 */
static void init_filter(void)
{
	static struct Hook filter_construct_hook;
	static struct Hook filter_destruct_hook;
	static struct Hook filter_display_hook;
	static struct Hook move_objstr_hook, move_strobj_hook;
	Object *ok_button, *cancel_button, *save_button;
	Object *filter_move_popobject, *filter_remote_label;

	init_hook(&filter_construct_hook,(HOOKFUNC)filter_construct);
	init_hook(&filter_destruct_hook,(HOOKFUNC)filter_destruct);
	init_hook(&filter_display_hook,(HOOKFUNC)filter_display);
	init_hook(&move_objstr_hook, (HOOKFUNC)move_objstr);
	init_hook(&move_strobj_hook, (HOOKFUNC)move_strobj);

	filter_wnd = WindowObject,
		MUIA_Window_ID, MAKE_ID('F','I','L','T'),
		MUIA_Window_Title, _("SimpleMail - Edit Filter"),
		WindowContents, VGroup,
			Child, VGroup,
				Child, HGroup,
					Child, VGroup,
						MUIA_HorizWeight,40,
						Child, VGroup,
							MUIA_Group_Spacing, 0,
							Child, NListviewObject,
								MUIA_NListview_NList, filter_list = FilterListObject,
									MUIA_NList_AutoVisible, 1, /* keep the active filter visible */
									MUIA_NList_ConstructHook, &filter_construct_hook,
									MUIA_NList_DestructHook, &filter_destruct_hook,
									MUIA_NList_DisplayHook, &filter_display_hook,
									End,
								End,
							Child, HGroup,
								Child, filter_name_string = UTF8StringObject,
									StringFrame,
									End,
								End,
							End,
						Child, ColGroup(2),
							Child, filter_new_button = MakeButton(_("_New")),
							Child, filter_remove_button = MakeButton(_("_Remove")),
							Child, filter_moveup_button = MakeButton(_("Move up")),
							Child, filter_movedown_button = MakeButton(_("Move Down")),
							End,
						End,
					Child, BalanceObject, End,
					Child, VGroup,
						Child, HorizLineTextObject(_("Activity")),
						Child, HGroup,
							Child, RectangleObject,MUIA_Weight,25,End,
							Child, ColGroup(5),
								Child, MakeLabel(_("On request")),
								Child, filter_request_check = MakeCheck(NULL,FALSE),
								Child, RectangleObject,MUIA_Weight,200,End,
								Child, MakeLabel(_("On sent mails")),
								Child, filter_sent_check = MakeCheck(NULL,FALSE),

								Child, filter_remote_label = MakeLabel(_("Remotly on POP3 server")),
								Child, filter_remote_check = MakeCheck(NULL,FALSE),
								Child, RectangleObject,MUIA_Weight,200,End,
								Child, MakeLabel(_("On new mails")),
								Child, filter_new_check = MakeCheck(NULL,FALSE),
								End,
							Child, RectangleObject,MUIA_Weight,25,End,
							End,
						Child, HorizLineTextObject(_("Rules")),
						Child, VGroupV,
							Child, filter_rule_group = ColGroup(2),
								Child, HVSpace,
								Child, HVSpace,
								End,
							End,
						Child, HGroup,
							Child, filter_add_rule_button = MakeButton(_("Add new rule")),
							Child, filter_apply_now_button = MakeButton(_("Apply now")),
							End,
						Child, HorizLineTextObject(_("Action")),
						Child, VGroup,
							Child, ColGroup(3),
								Child, MakeLabel(_("Move to Folder")),
								Child, filter_move_check = MakeCheck(_("Move to Folder"),FALSE),
								Child, filter_move_popobject = PopobjectObject,
									MUIA_Disabled, TRUE,
									MUIA_Popstring_Button, PopButton(MUII_PopUp),
									MUIA_Popstring_String, filter_move_text = TextObject, TextFrame, MUIA_Background, MUII_TextBack, End,
									MUIA_Popobject_ObjStrHook, &move_objstr_hook,
									MUIA_Popobject_StrObjHook, &move_strobj_hook,
									MUIA_Popobject_Object, NListviewObject,
										MUIA_NListview_NList, filter_folder_list = FolderTreelistObject,
											End,
										End,
									End,

								Child, MakeLabel(_("Execute ARexx Script")),
								Child, filter_arexx_check = MakeCheck(_("Execute ARexx Script"),FALSE),
								Child, filter_arexx_popasl = PopaslObject,
									MUIA_Disabled, TRUE,
									MUIA_Popstring_Button, PopButton(MUII_PopFile),
									MUIA_Popstring_String, filter_arexx_string = BetterStringObject,
										StringFrame,
										MUIA_CycleChain,1,
										MUIA_String_Acknowledge, TRUE,
										End,
									End,

								Child, MakeLabel(_("Play Sound")),
								Child, filter_sound_check = MakeCheck(_("Play Sound"),FALSE),
								Child, filter_sound_string = AudioSelectGroupObject, MUIA_Disabled, TRUE, End,

								End,
							End,
						End,
					End,
				End,
			Child, HorizLineObject,
			Child, HGroup,
				Child, save_button = MakeButton(Q_("?filter:_Save")),
				Child, ok_button = MakeButton(_("_Use")),
				Child, cancel_button = MakeButton(_("_Cancel")),
				End,
			End,
		End;

	if (filter_wnd)
	{
		char *short_help_txt = _("If activated the filter will be used remotly on POP3 servers\n"
                             "which support the TOP command. Mails which matches the filter\n"
														 "are presented to the user and automatically marked as to be ignored.");

		set(filter_remote_label, MUIA_ShortHelp, short_help_txt);
		set(filter_remote_check, MUIA_ShortHelp, short_help_txt);

		DoMethod(App, OM_ADDMEMBER, (ULONG)filter_wnd);
		DoMethod(filter_wnd, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, (ULONG)filter_wnd, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_cancel);
		DoMethod(ok_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_wnd, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_ok);
		DoMethod(save_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_wnd, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_ok);
		DoMethod(save_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_wnd, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)save_filter);
		DoMethod(cancel_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_wnd, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_cancel);

		DoMethod(filter_new_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_wnd, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_new);
		DoMethod(filter_remove_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_wnd, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_remove);
		DoMethod(filter_moveup_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_list, 3, MUIM_NList_Move, MUIV_NList_Move_Active, MUIV_NList_Move_Previous);
		DoMethod(filter_movedown_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_list, 3, MUIM_NList_Move, MUIV_NList_Move_Active, MUIV_NList_Move_Next);

		set(filter_name_string, MUIA_String_AttachedList, (ULONG)filter_list);
		DoMethod(filter_list, MUIM_Notify, MUIA_NList_Active, MUIV_EveryTime, (ULONG)filter_list, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_active);
		DoMethod(filter_name_string, MUIM_Notify, MUIA_String_Contents, MUIV_EveryTime, (ULONG)filter_list, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_name);

		DoMethod(filter_add_rule_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_wnd, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_add_rule_gui);
		DoMethod(filter_apply_now_button, MUIM_Notify, MUIA_Pressed, FALSE, (ULONG)filter_wnd, 3, MUIM_CallHook, (ULONG)&hook_standard, (ULONG)filter_apply);
		DoMethod(filter_move_check, MUIM_Notify, MUIA_Selected, MUIV_EveryTime, (ULONG)filter_move_popobject, 3, MUIM_Set, MUIA_Disabled, MUIV_NotTriggerValue);
		DoMethod(filter_sound_check, MUIM_Notify, MUIA_Selected, MUIV_EveryTime, (ULONG)filter_sound_string, 3, MUIM_Set, MUIA_Disabled, MUIV_NotTriggerValue);
		DoMethod(filter_arexx_check, MUIM_Notify, MUIA_Selected, MUIV_EveryTime, (ULONG)filter_arexx_popasl, 3, MUIM_Set, MUIA_Disabled, MUIV_NotTriggerValue);
		DoMethod(filter_folder_list, MUIM_Notify, MUIA_NList_DoubleClick, TRUE, (ULONG)filter_move_popobject, 2, MUIM_Popstring_Close, 1);

		filter_update_folder_list();
	}
}
Пример #6
0
Object *CreatePrefsGroup(struct InstData_MCP *data)
{
  Object *example;
  Object **objs = data->Objects;
  Object *group;
  static const char *key01[2];
  static const char *key02[2];
  static const char *key03[2];
  static const char *key04[2];
  static const char *key05[2];
  static const char *key06[2];
  static const char *key07[2];
  static const char *key08[2];
  static const char *key09[2];
  static const char *key10[2];
  static const char *key11[2];
  static const char *key12[2];
  static const char *key13[2];
  static const char *key14[2];
  static const char *key15[2];
  static const char *key16[2];
  static const char *key17[2];
  static const char *key18[2];

  static const char infotext1[] = "\033bBetterString.mcp " LIB_REV_STRING "\033n (" LIB_DATE ")\n"
                                  "Copyright (C) 1997-2000 Allan Odgaard\n"
                                  LIB_COPYRIGHT;
  static const char infotext2[] = "\n"
                                  "Distributed under the terms of the LGPL2.\n"
                                  "\n"
                                  "For the latest version, check out:\n"
                                  "http://www.sf.net/projects/bstring-mcc/\n"
                                  "\n";

  static const char **keyinfo[] =
  {
    key01, key02, key03, key04, key05, key06, key07, key08, key09, key10,
    key11, key12, key13, key14, key15, key16, key17, key18,
    NULL
  };

  key01[0] = GetStr(MSG_Help_Copy_Shortcut);                   key01[1] = GetStr(MSG_Help_Copy);
  key02[0] = GetStr(MSG_Help_Cut_Shortcut);                    key02[1] = GetStr(MSG_Help_Cut);
  key03[0] = GetStr(MSG_Help_Paste_Shortcut);                  key03[1] = GetStr(MSG_Help_Paste);
  key04[0] = GetStr(MSG_Help_Undo_Shortcut);                   key04[1] = GetStr(MSG_Help_Undo);
  key05[0] = GetStr(MSG_Help_Redo_Shortcut);                   key05[1] = GetStr(MSG_Help_Redo);
  key06[0] = GetStr(MSG_Help_ToggleBuffer_Shortcut);           key06[1] = GetStr(MSG_Help_ToggleBuffer);
  key07[0] = GetStr(MSG_Help_ToggleCaseChar_Shortcut);         key07[1] = GetStr(MSG_Help_ToggleCaseChar);
  key08[0] = GetStr(MSG_Help_ToggleCaseWord_Shortcut);         key08[1] = GetStr(MSG_Help_ToggleCaseWord);
  key09[0] = GetStr(MSG_Help_IncreaseNumber_Shortcut);         key09[1] = GetStr(MSG_Help_IncreaseNumber);
  key10[0] = GetStr(MSG_Help_DecreaseNumber_Shortcut);         key10[1] = GetStr(MSG_Help_DecreaseNumber);
  key11[0] = GetStr(MSG_Help_HexToDecimal_Shortcut);           key11[1] = GetStr(MSG_Help_HexToDecimal);
  key12[0] = GetStr(MSG_Help_DecimalToHex_Shortcut);           key12[1] = GetStr(MSG_Help_DecimalToHex);
  key13[0] = GetStr(MSG_Help_FilenameCompletition_Shortcut);   key13[1] = GetStr(MSG_Help_FilenameCompletition);
  key14[0] = GetStr(MSG_Help_Mark_Shortcut);                   key14[1] = GetStr(MSG_Help_Mark);
  key15[0] = GetStr(MSG_Help_GotoToStartEndOfLine_Shortcut);   key15[1] = GetStr(MSG_Help_GotoToStartEndOfLine);
  key16[0] = GetStr(MSG_Help_DeleteToStartEndOfLine_Shortcut); key16[1] = GetStr(MSG_Help_DeleteToStartEndOfLine);
  key17[0] = GetStr(MSG_Help_GotoToPrevNextWord_Shortcut);     key17[1] = GetStr(MSG_Help_GotoToPrevNextWord);
  key18[0] = GetStr(MSG_Help_DeleteToPrevNextWord_Shortcut);   key18[1] = GetStr(MSG_Help_DeleteToPrevNextWord);

  group = VGroup,

    Child, PopobjectObject,
      MUIA_Popstring_String,  example = BetterStringObject, StringFrame,
        MUIA_String_Contents,  GetStr(MSG_String_TestString),
        MUIA_String_Format,    MUIV_String_Format_Center,
        MUIA_CycleChain,      TRUE,
        End,
      MUIA_Popstring_Button, PopButton(MUII_PopUp),
      MUIA_Popobject_Object, ListviewObject,
        MUIA_Listview_Input,    FALSE,
        MUIA_Listview_List,    ListObject, ReadListFrame,
          MUIA_List_DisplayHook,    &DisplayHook,
          MUIA_List_Format,        ",,",
          MUIA_List_SourceArray,    keyinfo,
          End,
        End,
      End,

    Child, VSpace(4),

    Child, ColGroup(2),
      Child, HSpace(-1),
      Child, HGroup,
        MUIA_Group_SameWidth, TRUE,
        Child, TextObject,
          MUIA_Font,          MUIV_Font_Tiny,
          MUIA_Text_Contents,  GetStr(MSG_Label_Background),
          MUIA_Text_PreParse, "\33c",
          End,
        Child, TextObject,
          MUIA_Font,          MUIV_Font_Tiny,
          MUIA_Text_Contents,  GetStr(MSG_Label_Text),
          MUIA_Text_PreParse, "\33c",
          End,
        End,

      Child, TxtLabel(GetStr(MSG_Label_Inactive)),
      Child, HGroup,
        Child, objs[InactiveBack] = PopimageObject,
          MUIA_Imageadjust_Type,  2,
          MUIA_CycleChain,      TRUE,
          MUIA_FixHeight,       0,
          End,
        Child, objs[InactiveText] = PoppenObject,
          MUIA_CycleChain,      TRUE,
          MUIA_FixHeight,       0,
          End,
        End,

      Child, TxtLabel(GetStr(MSG_Label_Active)),
      Child, HGroup,
        Child, objs[ActiveBack] = PopimageObject,
          MUIA_Imageadjust_Type,  2,
          MUIA_CycleChain,      TRUE,
          MUIA_FixHeight,       0,
          End,
        Child, objs[ActiveText] = PoppenObject,
          MUIA_CycleChain,      TRUE,
          MUIA_FixHeight,       0,
          End,
        End,

      Child, HSpace(-1),
      Child, RectangleObject,
        MUIA_Rectangle_HBar,  TRUE,
        MUIA_VertWeight,      0,
        End,

      Child, TxtLabel(GetStr(MSG_Label_Cursor)),
      Child, objs[Cursor] = PoppenObject,
        MUIA_CycleChain, TRUE,
        MUIA_FixHeight,  0,
        End,

      Child, TxtLabel(GetStr(MSG_Label_Marked)),
      Child, HGroup,
        Child, objs[MarkedBack] = PoppenObject,
          MUIA_CycleChain, TRUE,
          MUIA_FixHeight,  0,
          End,
        Child, objs[MarkedText] = PoppenObject,
          MUIA_CycleChain, TRUE,
          MUIA_FixHeight,  0,
          End,
        End,

      Child, HSpace(-1),
      Child, RectangleObject,
        MUIA_Rectangle_HBar,  TRUE,
        MUIA_VertWeight,      0,
      End,

      Child, HSpace(-1),
      Child, HGroup,
	    MUIA_Weight, 0,
        Child, objs[SelectOnActive] = MUI_MakeObject(MUIO_Checkmark, NULL),
        Child, TxtLLabel(GetStr(MSG_SelectOnActive)),
        Child, HSpace(-1),
      End,

      Child, HSpace(-1),
      Child, HGroup,
	    MUIA_Weight, 0,
        Child, objs[SelectPointer] = MUI_MakeObject(MUIO_Checkmark, NULL),
        Child, TxtLLabel(GetStr(MSG_SelectPointer)),
        Child, HSpace(-1),
      End,

    End,

    Child, CrawlingObject,
      TextFrame,
      MUIA_FixHeightTxt, infotext1,
      MUIA_Background,   "m1",

      Child, TextObject,
        MUIA_Text_Copy, FALSE,
        MUIA_Text_PreParse, "\033c",
        MUIA_Text_Contents, infotext1,
      End,

      Child, TextObject,
        MUIA_Text_Copy, FALSE,
        MUIA_Text_PreParse, "\033c",
        MUIA_Text_Contents, infotext2,
      End,

      Child, TextObject,
        MUIA_Text_Copy, FALSE,
        MUIA_Text_PreParse, "\033c",
        MUIA_Text_Contents, infotext1,
      End,
    End,

  End;

  // the inactive background will be the same as for String.mui on MUI4
  if(objs[InactiveBack] != NULL)
    set(objs[InactiveBack], MUIA_Disabled, data->mui4x);

  // the active background will be the same as for String.mui on MUI4
  if(objs[ActiveBack] != NULL)
    set(objs[ActiveBack], MUIA_Disabled, data->mui4x);

  if(objs[SelectOnActive] != NULL)
    set(objs[SelectOnActive], MUIA_ShortHelp, GetStr(MSG_HELP_SelectOnActive));

  // disable the pointer checkmark in case MUI already handles custom pointer types
  if(objs[SelectPointer] != NULL)
  {
    SetAttrs(objs[SelectPointer],
      MUIA_ShortHelp, GetStr(MSG_HELP_SelectPointer),
      MUIA_Disabled, xget(example, MUIA_PointerType) != MUIV_PointerType_Normal,
      TAG_DONE);
  }

  return group;
}
Пример #7
0
///
/// MakeXPKPop
// creates a popup list of available XPK sublibraries
static Object *MakeXPKPop(Object **text, BOOL encrypt)
{
  Object *lv;
  Object *list;
  Object *po;
  Object *but;

  ENTER();

  if((po = PopobjectObject,
    MUIA_Popstring_String, *text = TextObject,
      TextFrame,
      MUIA_Background, MUII_TextBack,
      MUIA_FixWidthTxt, "MMMM",
    End,
    MUIA_Popstring_Button, but = PopButton(MUII_PopUp),
    MUIA_Popobject_StrObjHook, &PO_XPKOpenHook,
    MUIA_Popobject_ObjStrHook, &PO_XPKCloseHook,
    MUIA_Popobject_WindowHook, &PO_WindowHook,
    MUIA_Popobject_Object, lv = ListviewObject,
      MUIA_Listview_List, list = ListObject,
        InputListFrame,
        MUIA_List_AutoVisible,   TRUE,
        MUIA_List_ConstructHook, MUIV_List_ConstructHook_String,
        MUIA_List_DestructHook,  MUIV_List_DestructHook_String,
      End,
    End,
  End))
  {
    // disable the XPK popups if xpkmaster.library is not available
    if(XpkBase == NULL)
    {
      set(po, MUIA_Disabled, TRUE);
      set(but, MUIA_Disabled, TRUE);
    }
    else
    {
      struct xpkPackerNode *xpkNode;

      IterateList(G->xpkPackerList, struct xpkPackerNode *, xpkNode)
      {
        BOOL suits = TRUE;

        D(DBF_XPK, "XPK lib '%s' has flags %08lx", xpkNode->info.xpi_Name, xpkNode->info.xpi_Flags);

        if(encrypt == TRUE && isFlagClear(xpkNode->info.xpi_Flags, XPKIF_ENCRYPTION))
        {
          D(DBF_XPK, "'%s' has no encryption capabilities, excluded from encryption list", xpkNode->info.xpi_Name);
          suits = FALSE;
        }

        if(suits == TRUE)
          DoMethod(list, MUIM_List_InsertSingle, xpkNode->info.xpi_Name, MUIV_List_Insert_Sorted);
      }

      DoMethod(lv, MUIM_Notify, MUIA_Listview_DoubleClick, TRUE, po, 2, MUIM_Popstring_Close, TRUE);
    }
  }

  RETURN(po);
  return po;
}
Пример #8
0
/*** Methods ****************************************************************/
Object * NetPEditor__OM_NEW(Class *CLASS, Object *self, struct opSet *message)
{
    Object  *deviceString, *IPString, *maskString, *gateString,
            *DNSString[2], *hostString, *domainString, *DHCPState, *autostart;

    DHCPCycle[0] = _(MSG_IP_MODE_MANUAL);
    DHCPCycle[1] = _(MSG_IP_MODE_DHCP);

    NetworkTabs[0] = _(MSG_TAB_IP_CONFIGURATION);
    NetworkTabs[1] = _(MSG_TAB_COMPUTER_NAME);

    self = (Object *)DoSuperNewTags
           (
               CLASS, self, NULL,

               MUIA_PrefsEditor_Name, __(MSG_NAME),
               MUIA_PrefsEditor_Path, (IPTR)"AROSTCP/arostcp.prefs",


               Child, RegisterGroup((IPTR)NetworkTabs),
               Child, (IPTR)ColGroup(2),
               Child, (IPTR)Label2(__(MSG_DEVICE)),Child, (IPTR)PopaslObject,
               MUIA_Popasl_Type,              ASL_FileRequest,
               ASLFO_MaxHeight,               100,
               MUIA_Popstring_String,  (IPTR)(deviceString = (Object *)StringObject, TextFrame, MUIA_Background, MUII_TextBack, End),
               MUIA_Popstring_Button,  (IPTR)PopButton(MUII_PopUp),
               End,

               Child, (IPTR)Label2(__(MSG_IP_MODE)), Child, (IPTR)(DHCPState = (Object *)CycleObject, MUIA_Cycle_Entries, (IPTR)DHCPCycle, End),
               Child, (IPTR)Label2(__(MSG_IP)), Child, (IPTR)(IPString = (Object *)StringObject, TextFrame, MUIA_String_Accept, (IPTR)"0123456789.", End),
               Child, (IPTR)Label2(__(MSG_MASK)),Child, (IPTR)(maskString = (Object *)StringObject, TextFrame, MUIA_String_Accept, (IPTR)"0123456789.", End),
               Child, (IPTR)Label2(__(MSG_GATE)),Child, (IPTR)(gateString = (Object *)StringObject, TextFrame, MUIA_String_Accept, (IPTR)"0123456789.", End),
               Child, (IPTR)Label2(__(MSG_DNS1)),Child, (IPTR)(DNSString[0] = (Object *)StringObject, TextFrame, MUIA_String_Accept, (IPTR)"0123456789.", End),
               Child, (IPTR)Label2(__(MSG_DNS2)),Child, (IPTR)(DNSString[1] = (Object *)StringObject, TextFrame, MUIA_String_Accept, (IPTR)"0123456789.", End),
               Child, (IPTR)Label2(__(MSG_AUTOSTART_STACK)),
               Child, (IPTR)HGroup,
               Child, (IPTR)(autostart = MUI_MakeObject(MUIO_Checkmark, NULL)),
               Child, (IPTR)HVSpace,
               End,
               End,

               Child, (IPTR)ColGroup(2),
               Child, (IPTR)Label2(__(MSG_HOST_NAME)), Child, (IPTR)(hostString = (Object *)StringObject, TextFrame, MUIA_String_Accept, (IPTR)"0123456789abcdefghijklmnopqrstuvwxyz-", End),
               Child, (IPTR)Label2(__(MSG_DOMAIN_NAME)), Child, (IPTR)(domainString = (Object *)StringObject, TextFrame, MUIA_String_Accept, (IPTR)"0123456789abcdefghijklmnopqrstuvwxyz-.", End),
               End,

               End, // register

               TAG_DONE
           );


    if (self != NULL) {
        struct NetPEditor_DATA *data = INST_DATA(CLASS, self);
        data->netped_deviceString  = deviceString;
        data->netped_IPString = IPString;
        data->netped_maskString = maskString;
        data->netped_gateString = gateString;
        data->netped_DNSString[0] = DNSString[0];
        data->netped_DNSString[1] = DNSString[1];
        data->netped_hostString = hostString;
        data->netped_domainString = domainString;
        data->netped_DHCPState = DHCPState;
        data->netped_Autostart = autostart;

        /*-- Setup notifications -------------------------------------------*/
        DoMethod
        (
            deviceString, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime,
            (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE
        );
        DoMethod
        (
            IPString, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime,
            (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE
        );
        DoMethod
        (
            maskString, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime,
            (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE
        );

        DoMethod
        (
            gateString, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime,
            (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE
        );
        DoMethod
        (
            DNSString[0], MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime,
            (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE
        );
        DoMethod
        (
            DNSString[1], MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime,
            (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE
        );
        DoMethod
        (
            hostString, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime,
            (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE
        );
        DoMethod
        (
            domainString, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime,
            (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE
        );
        DoMethod
        (
            autostart, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime,
            (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE
        );
        DoMethod
        (
            DHCPState, MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime,
            (IPTR)self, 1, MUIM_NetPEditor_IPModeChanged

        );
    }

    return self;
}
Пример #9
0
/// US_New
//  Creates user list window
static struct US_ClassData *US_New(BOOL supervisor)
{
  struct US_ClassData *data;

  ENTER();

  if((data = calloc(1, sizeof(struct US_ClassData))) != NULL)
  {
    data->Supervisor = supervisor;
    data->GUI.WI = WindowObject,
       MUIA_Window_Title, tr(MSG_MA_MUsers),
       MUIA_Window_ScreenTitle, CreateScreenTitle(data->ScreenTitle, sizeof(data->ScreenTitle), tr(MSG_MA_MUsers)),
       MUIA_HelpNode, "Windows/Userswindow",
       MUIA_Window_ID, MAKE_ID('U','S','E','R'),
       WindowContents, VGroup,
          Child, NListviewObject,
             MUIA_CycleChain, TRUE,
             MUIA_NListview_NList, data->GUI.LV_USERS = UserListObject,
             End,
          End,
          Child, VGroup, GroupFrameT(tr(MSG_MA_Settings)),
             Child, ColGroup(2),
                Child, Label2(tr(MSG_US_UserName)),
                Child, data->GUI.ST_USER = MakeString(SIZE_NAME, tr(MSG_US_UserName)),
                Child, Label2(tr(MSG_US_Password)),
                Child, data->GUI.ST_PASSWD = MakePassString(tr(MSG_US_Password)),
                Child, Label2(tr(MSG_US_MailDirectory)),
                Child, data->GUI.PO_MAILDIR = PopaslObject,
                   MUIA_Popasl_Type,ASL_FileRequest,
                   MUIA_Popstring_String,data->GUI.ST_MAILDIR = MakeString(SIZE_PATH,tr(MSG_US_MailDirectory)),
                   MUIA_Popstring_Button,PopButton(MUII_PopDrawer),
                   ASLFR_DrawersOnly, TRUE,
                End,
             End,
             Child, VGroup,
                Child, MakeCheckGroup((Object **)&data->GUI.CH_USEADDR, tr(MSG_US_GlobalAddrBook)),
                Child, MakeCheckGroup((Object **)&data->GUI.CH_USEDICT, tr(MSG_US_GlobalDict)),
                Child, MakeCheckGroup((Object **)&data->GUI.CH_ROOT,tr(MSG_US_SuperVisor)),
             End,
             Child, VGroup,
                MUIA_ShowMe, supervisor,
                Child, MakeCheckGroup((Object **)&data->GUI.CH_CLONE, tr(MSG_US_CopyConfig)),
             End,
          End,
          Child, ColGroup(2),
             MUIA_ShowMe, supervisor,
             Child, data->GUI.BT_ADD = MakeButton(tr(MSG_US_AddUser)),
             Child, data->GUI.BT_DEL = MakeButton(tr(MSG_US_DelUser)),
          End,
       End,
    End;

    if(data->GUI.WI != NULL)
    {
      DoMethod(G->App, OM_ADDMEMBER, data->GUI.WI);

      SetHelp(data->GUI.ST_USER   ,MSG_HELP_US_ST_USER);
      SetHelp(data->GUI.ST_MAILDIR,MSG_HELP_US_ST_MAILDIR);
      SetHelp(data->GUI.ST_PASSWD ,MSG_HELP_US_ST_PASSWD);
      SetHelp(data->GUI.CH_USEADDR,MSG_HELP_US_CH_USEADDR);
      SetHelp(data->GUI.CH_USEDICT,MSG_HELP_US_CH_USEDICT);
      SetHelp(data->GUI.CH_CLONE  ,MSG_HELP_US_CH_CLONE);
      SetHelp(data->GUI.CH_ROOT   ,MSG_HELP_US_CH_ROOT);
      SetHelp(data->GUI.BT_ADD    ,MSG_HELP_US_BT_ADD);
      SetHelp(data->GUI.BT_DEL    ,MSG_HELP_US_BT_DEL);

      DoMethod(data->GUI.LV_USERS,  MUIM_Notify,MUIA_NList_Active,       MUIV_EveryTime,MUIV_Notify_Application,2,MUIM_CallHook,&US_GetUSEntryHook);
      DoMethod(data->GUI.ST_USER,   MUIM_Notify,MUIA_String_Contents,    MUIV_EveryTime,MUIV_Notify_Application,2,MUIM_CallHook,&US_PutUSEntryHook);
      DoMethod(data->GUI.ST_MAILDIR,MUIM_Notify,MUIA_String_Contents,    MUIV_EveryTime,MUIV_Notify_Application,2,MUIM_CallHook,&US_PutUSEntryHook);
      DoMethod(data->GUI.ST_PASSWD, MUIM_Notify,MUIA_String_Contents,    MUIV_EveryTime,MUIV_Notify_Application,2,MUIM_CallHook,&US_PutUSEntryHook);
      DoMethod(data->GUI.CH_USEADDR,MUIM_Notify,MUIA_Selected,           MUIV_EveryTime,MUIV_Notify_Application,2,MUIM_CallHook,&US_PutUSEntryHook);
      DoMethod(data->GUI.CH_USEDICT,MUIM_Notify,MUIA_Selected,           MUIV_EveryTime,MUIV_Notify_Application,2,MUIM_CallHook,&US_PutUSEntryHook);
      DoMethod(data->GUI.CH_ROOT,   MUIM_Notify,MUIA_Selected,           MUIV_EveryTime,MUIV_Notify_Application,2,MUIM_CallHook,&US_PutUSEntryHook);
      DoMethod(data->GUI.CH_CLONE,  MUIM_Notify,MUIA_Selected,           MUIV_EveryTime,MUIV_Notify_Application,2,MUIM_CallHook,&US_PutUSEntryHook);
      DoMethod(data->GUI.BT_ADD,    MUIM_Notify,MUIA_Pressed,            FALSE         ,MUIV_Notify_Application,2,MUIM_CallHook,&US_AddHook);
      DoMethod(data->GUI.BT_DEL,    MUIM_Notify,MUIA_Pressed,            FALSE         ,MUIV_Notify_Application,2,MUIM_CallHook,&US_DelHook);
      DoMethod(data->GUI.WI,        MUIM_Notify,MUIA_Window_CloseRequest,TRUE          ,MUIV_Notify_Application,2,MUIM_CallHook,&US_CloseHook);
    }
    else
    {
      free(data);
      data = NULL;
    }
  }

  RETURN(data);
  return data;
}