Patch level : 2.0 488
Files correlati : xvaga.dll Ricompilazione Demo : [ ] Commento : Aggiunta funzione xvt_menu_popup git-svn-id: svn://10.65.10.50/trunk@11207 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
3be2f51b01
commit
ca8575a3de
@ -23,6 +23,7 @@
|
||||
#include <unistd.h>
|
||||
#include "oslinux.h"
|
||||
#endif
|
||||
#include <io.h>
|
||||
|
||||
// Funzione interna di utilita'
|
||||
MENU_ITEM* xvt_menu_duplicate_tree(const MENU_ITEM* m);
|
||||
@ -2883,6 +2884,25 @@ MENU_ITEM* xvt_menu_get_tree(WINDOW win)
|
||||
return m;
|
||||
}
|
||||
|
||||
BOOLEAN xvt_menu_popup(MENU_ITEM *menu_p, WINDOW win, PNT pos,
|
||||
XVT_POPUP_ALIGNMENT /* alignment */, MENU_TAG /* item */)
|
||||
{
|
||||
wxMenu menu;
|
||||
for (MENU_ITEM* mi = menu_p; mi != NULL && mi->tag != 0; mi++)
|
||||
{
|
||||
wxMenuItem* item = NULL;
|
||||
if (mi->separator)
|
||||
item = new wxMenuItem(&menu, wxID_SEPARATOR);
|
||||
else
|
||||
item = new wxMenuItem(&menu, mi->tag, mi->text, wxEmptyString, mi->checkable);
|
||||
menu.DoAppend(item);
|
||||
}
|
||||
CAST_WIN(win, w);
|
||||
bool ok = w.PopupMenu(&menu, pos.h, pos.v);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
static void TranslateMenu(wxMenu* pMenu, TRANSLATE_CALLBACK tc)
|
||||
{
|
||||
wxMenuItemList& list = pMenu->GetMenuItems();
|
||||
@ -3782,11 +3802,7 @@ void xvt_sys_searchenv(const char * filename, const char * varname, char * pathn
|
||||
|
||||
BOOLEAN xvt_fsys_access(const char *pathname, int mode)
|
||||
{
|
||||
#ifdef WIN32
|
||||
return _access(pathname, mode);
|
||||
#else
|
||||
return access(pathname, mode);
|
||||
#endif
|
||||
}
|
||||
|
||||
BOOLEAN xvt_fsys_file_exists(const char *pathname)
|
||||
|
@ -16,7 +16,6 @@
|
||||
#else
|
||||
#define XVTDLL __declspec(dllimport)
|
||||
#endif
|
||||
#include <io.h>
|
||||
#else
|
||||
#define XVTDLL
|
||||
#endif
|
||||
@ -191,6 +190,7 @@ XVTDLL DATA_PTR xvt_mem_rep(DATA_PTR dst, DATA_PTR src, unsigned int srclen, lo
|
||||
XVTDLL DATA_PTR xvt_mem_zalloc(size_t size);
|
||||
|
||||
XVTDLL MENU_ITEM* xvt_menu_get_tree(WINDOW win);
|
||||
XVTDLL BOOLEAN xvt_menu_popup(MENU_ITEM *menu_p, WINDOW win, PNT pos, XVT_POPUP_ALIGNMENT alignment, MENU_TAG item);
|
||||
XVTDLL void xvt_menu_set_font_sel(WINDOW win, XVT_FNTID font_id);
|
||||
XVTDLL void xvt_menu_set_item_checked(WINDOW win, MENU_TAG tag, BOOLEAN check);
|
||||
XVTDLL void xvt_menu_set_item_enabled(WINDOW win, MENU_TAG tag, BOOLEAN enable);
|
||||
|
@ -100,6 +100,13 @@ unsigned separator: 1; /* separator? */
|
||||
struct s_mitem *child; /* pointer to submenu */
|
||||
} MENU_ITEM;
|
||||
|
||||
typedef enum e_popup_alignment {
|
||||
XVT_POPUP_CENTER,
|
||||
XVT_POPUP_LEFT_ALIGN,
|
||||
XVT_POPUP_RIGHT_ALIGN,
|
||||
XVT_POPUP_OVER_ITEM
|
||||
} XVT_POPUP_ALIGNMENT;
|
||||
|
||||
#define SZ_FNAME _MAX_FNAME
|
||||
|
||||
typedef struct { /* file specification */
|
||||
|
Loading…
x
Reference in New Issue
Block a user