AxWin3_Widget_SetSize(ele, 4);
// > Version/Time
- ele = AxWin3_Widget_AddWidget(gSidebarRoot, ELETYPE_BOX, ELEFLAG_VERTICAL|ELEFLAG_ALIGN_CENTER|ELEFLAG_NOSTRETCH, "Version/Time");
+ ele = AxWin3_Widget_AddWidget(gSidebarRoot,
+ ELETYPE_BOX,
+ ELEFLAG_VERTICAL|ELEFLAG_ALIGN_CENTER|ELEFLAG_NOSTRETCH,
+ "Version/Time"
+ );
txt = AxWin3_Widget_AddWidget(ele, ELETYPE_TEXT, ELEFLAG_NOSTRETCH, "Version String");
AxWin3_Widget_SetSize(txt, 20);
AxWin3_Widget_SetText(txt, "3.0");
gSystemMenu = AxWin3_Menu_Create(NULL);
AxWin3_Menu_AddItem(gSystemMenu, "Text &Editor\tWin+E", mainmenu_app_textedit, NULL, 0, NULL);
- AxWin3_Menu_AddItem(gSystemMenu, "Terminal Emulator\tWin+T", mainmenu_app_terminal, NULL, 0, NULL);
+ AxWin3_Menu_AddItem(gSystemMenu, "&Terminal Emulator\tWin+T", mainmenu_app_terminal, NULL, 0, NULL);
AxWin3_Menu_AddItem(gSystemMenu, NULL, NULL, NULL, 0, NULL);
- AxWin3_Menu_AddItem(gSystemMenu, "Run\tWin+R", mainmenu_run_dialog, NULL, 0, NULL);
+ AxWin3_Menu_AddItem(gSystemMenu, "&Run\tWin+R", mainmenu_run_dialog, NULL, 0, NULL);
}
int run_dorun(tAxWin3_Widget *unused)
}
else
{
- char tmp = item->Label[item->KeyOffset];
// Get width of preceding substring
WM_Render_GetTextDims(NULL, item->Label, item->KeyOffset, &item->UnderlineX, NULL);
// Get the width of the underlined character
- item->Label[item->KeyOffset] = tmp;
// NOTE: 1 makes only one character be parsed, even if it is >1 byte long
WM_Render_GetTextDims(
NULL, item->Label+item->KeyOffset, 1,
&item->UnderlineW, NULL
);
- item->Label[item->KeyOffset+1] = tmp;
}
// - Labels
WM_Render_GetTextDims(NULL, item->Label, -1, &item->LabelWidth, NULL);
WM_Render_GetTextDims(NULL, item->Shortcut, -1, &item->ShortcutWidth, NULL);
else
item->ShortcutWidth = 0;
-
+
+ // Get maximum lengths (to determine the size of the menu
if( item->LabelWidth > info->MaxLabelWidth )
info->MaxLabelWidth = item->LabelWidth;
if( item->ShortcutWidth > info->MaxShortcutWidth )
info->MaxShortcutWidth = item->ShortcutWidth;
+ // Update width
+ // TODO: Check, do I want to resize down too?
+ // TODO: Take into account padding too
if( info->MaxLabelWidth + info->MaxShortcutWidth + ciMenu_Gap > info->CachedW )
{
info->CachedW = ciMenu_LeftPadding + info->MaxLabelWidth
return 0;
}
+/**
+ * \brief Convert coordinates into an item index
+ */
int Renderer_Menu_int_GetItemByPos(tWindow *Window, tMenuWindowInfo *Info, int X, int Y)
{
int i;