1. implemented wxRegKey::Copy() and CopyValue()
2. regtest sample doesn't crash any more 3. wxLogGui uses msg box for only 1 message 4. "const wxEventType" => "enum" 5. wxEVT_COMMAND_TREE_END_DRAG introduced - see sample for example 6. fixed several non fatal bugs in wxRegKey 7. many changes in regtest sample, not tested yet git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6017 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -42,489 +42,229 @@ class WXDLLEXPORT wxList;
|
|||||||
// Event types
|
// Event types
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
typedef int wxEventType;
|
|
||||||
|
|
||||||
#if defined(__VISAGECPP__) && __IBMCPP__ >= 400
|
|
||||||
// must define these static for VA or else you get multiply defined symbols everywhere
|
|
||||||
extern const wxEventType wxEVT_NULL;
|
|
||||||
extern const wxEventType wxEVT_FIRST;
|
|
||||||
|
|
||||||
extern const wxEventType wxEVT_COMMAND_BUTTON_CLICKED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_CHECKBOX_CLICKED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_CHOICE_SELECTED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LISTBOX_SELECTED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LISTBOX_DOUBLECLICKED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_CHECKLISTBOX_TOGGLED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TEXT_UPDATED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TEXT_ENTER;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_MENU_SELECTED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TOOL_CLICKED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_SLIDER_UPDATED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_RADIOBOX_SELECTED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_RADIOBUTTON_SELECTED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_SCROLLBAR_UPDATED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_VLBOX_SELECTED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_COMBOBOX_SELECTED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TOOL_RCLICKED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TOOL_ENTER;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_SPINCTRL_UPDATED;
|
|
||||||
|
|
||||||
/* Sockets and timers send events, too */
|
|
||||||
extern const wxEventType wxEVT_SOCKET;
|
|
||||||
extern const wxEventType wxEVT_TIMER;
|
|
||||||
|
|
||||||
/* Mouse event types */
|
|
||||||
extern const wxEventType wxEVT_LEFT_DOWN;
|
|
||||||
extern const wxEventType wxEVT_LEFT_UP;
|
|
||||||
extern const wxEventType wxEVT_MIDDLE_DOWN;
|
|
||||||
extern const wxEventType wxEVT_MIDDLE_UP;
|
|
||||||
extern const wxEventType wxEVT_RIGHT_DOWN;
|
|
||||||
extern const wxEventType wxEVT_RIGHT_UP;
|
|
||||||
extern const wxEventType wxEVT_MOTION;
|
|
||||||
extern const wxEventType wxEVT_ENTER_WINDOW;
|
|
||||||
extern const wxEventType wxEVT_LEAVE_WINDOW;
|
|
||||||
extern const wxEventType wxEVT_LEFT_DCLICK;
|
|
||||||
extern const wxEventType wxEVT_MIDDLE_DCLICK;
|
|
||||||
extern const wxEventType wxEVT_RIGHT_DCLICK;
|
|
||||||
extern const wxEventType wxEVT_SET_FOCUS;
|
|
||||||
extern const wxEventType wxEVT_KILL_FOCUS;
|
|
||||||
|
|
||||||
/* Non-client mouse events */
|
|
||||||
extern const wxEventType wxEVT_NC_LEFT_DOWN;
|
|
||||||
extern const wxEventType wxEVT_NC_LEFT_UP;
|
|
||||||
extern const wxEventType wxEVT_NC_MIDDLE_DOWN;
|
|
||||||
extern const wxEventType wxEVT_NC_MIDDLE_UP;
|
|
||||||
extern const wxEventType wxEVT_NC_RIGHT_DOWN;
|
|
||||||
extern const wxEventType wxEVT_NC_RIGHT_UP;
|
|
||||||
extern const wxEventType wxEVT_NC_MOTION;
|
|
||||||
extern const wxEventType wxEVT_NC_ENTER_WINDOW;
|
|
||||||
extern const wxEventType wxEVT_NC_LEAVE_WINDOW;
|
|
||||||
extern const wxEventType wxEVT_NC_LEFT_DCLICK;
|
|
||||||
extern const wxEventType wxEVT_NC_MIDDLE_DCLICK;
|
|
||||||
extern const wxEventType wxEVT_NC_RIGHT_DCLICK;
|
|
||||||
|
|
||||||
/* Character input event type */
|
|
||||||
extern const wxEventType wxEVT_CHAR;
|
|
||||||
extern const wxEventType wxEVT_CHAR_HOOK;
|
|
||||||
extern const wxEventType wxEVT_NAVIGATION_KEY;
|
|
||||||
extern const wxEventType wxEVT_KEY_DOWN;
|
|
||||||
extern const wxEventType wxEVT_KEY_UP;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* wxScrollbar and wxSlider event identifiers
|
|
||||||
*/
|
|
||||||
extern const wxEventType wxEVT_SCROLL_TOP;
|
|
||||||
extern const wxEventType wxEVT_SCROLL_BOTTOM;
|
|
||||||
extern const wxEventType wxEVT_SCROLL_LINEUP;
|
|
||||||
extern const wxEventType wxEVT_SCROLL_LINEDOWN;
|
|
||||||
extern const wxEventType wxEVT_SCROLL_PAGEUP;
|
|
||||||
extern const wxEventType wxEVT_SCROLL_PAGEDOWN;
|
|
||||||
extern const wxEventType wxEVT_SCROLL_THUMBTRACK;
|
|
||||||
extern const wxEventType wxEVT_SCROLL_THUMBRELEASE;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Scroll events from wxWindow
|
|
||||||
*/
|
|
||||||
extern const wxEventType wxEVT_SCROLLWIN_TOP;
|
|
||||||
extern const wxEventType wxEVT_SCROLLWIN_BOTTOM;
|
|
||||||
extern const wxEventType wxEVT_SCROLLWIN_LINEUP;
|
|
||||||
extern const wxEventType wxEVT_SCROLLWIN_LINEDOWN;
|
|
||||||
extern const wxEventType wxEVT_SCROLLWIN_PAGEUP;
|
|
||||||
extern const wxEventType wxEVT_SCROLLWIN_PAGEDOWN;
|
|
||||||
extern const wxEventType wxEVT_SCROLLWIN_THUMBTRACK;
|
|
||||||
extern const wxEventType wxEVT_SCROLLWIN_THUMBRELEASE;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* System events
|
|
||||||
*/
|
|
||||||
extern const wxEventType wxEVT_SIZE;
|
|
||||||
extern const wxEventType wxEVT_MOVE;
|
|
||||||
extern const wxEventType wxEVT_CLOSE_WINDOW;
|
|
||||||
extern const wxEventType wxEVT_END_SESSION;
|
|
||||||
extern const wxEventType wxEVT_QUERY_END_SESSION;
|
|
||||||
extern const wxEventType wxEVT_ACTIVATE_APP;
|
|
||||||
extern const wxEventType wxEVT_POWER;
|
|
||||||
extern const wxEventType wxEVT_ACTIVATE;
|
|
||||||
extern const wxEventType wxEVT_CREATE;
|
|
||||||
extern const wxEventType wxEVT_DESTROY;
|
|
||||||
extern const wxEventType wxEVT_SHOW;
|
|
||||||
extern const wxEventType wxEVT_ICONIZE;
|
|
||||||
extern const wxEventType wxEVT_MAXIMIZE;
|
|
||||||
extern const wxEventType wxEVT_MOUSE_CAPTURE_CHANGED;
|
|
||||||
extern const wxEventType wxEVT_PAINT;
|
|
||||||
extern const wxEventType wxEVT_ERASE_BACKGROUND;
|
|
||||||
extern const wxEventType wxEVT_NC_PAINT;
|
|
||||||
extern const wxEventType wxEVT_PAINT_ICON;
|
|
||||||
extern const wxEventType wxEVT_MENU_CHAR;
|
|
||||||
extern const wxEventType wxEVT_MENU_INIT;
|
|
||||||
extern const wxEventType wxEVT_MENU_HIGHLIGHT;
|
|
||||||
extern const wxEventType wxEVT_POPUP_MENU_INIT;
|
|
||||||
extern const wxEventType wxEVT_CONTEXT_MENU;
|
|
||||||
extern const wxEventType wxEVT_SYS_COLOUR_CHANGED;
|
|
||||||
extern const wxEventType wxEVT_SETTING_CHANGED;
|
|
||||||
extern const wxEventType wxEVT_QUERY_NEW_PALETTE;
|
|
||||||
extern const wxEventType wxEVT_PALETTE_CHANGED;
|
|
||||||
extern const wxEventType wxEVT_JOY_BUTTON_DOWN;
|
|
||||||
extern const wxEventType wxEVT_JOY_BUTTON_UP;
|
|
||||||
extern const wxEventType wxEVT_JOY_MOVE;
|
|
||||||
extern const wxEventType wxEVT_JOY_ZMOVE;
|
|
||||||
extern const wxEventType wxEVT_DROP_FILES;
|
|
||||||
extern const wxEventType wxEVT_DRAW_ITEM;
|
|
||||||
extern const wxEventType wxEVT_MEASURE_ITEM;
|
|
||||||
extern const wxEventType wxEVT_COMPARE_ITEM;
|
|
||||||
extern const wxEventType wxEVT_INIT_DIALOG;
|
|
||||||
extern const wxEventType wxEVT_IDLE;
|
|
||||||
extern const wxEventType wxEVT_UPDATE_UI;
|
|
||||||
|
|
||||||
/* System misc. */
|
|
||||||
extern const wxEventType wxEVT_END_PROCESS;
|
|
||||||
|
|
||||||
/* Dial up events */
|
|
||||||
extern const wxEventType wxEVT_DIALUP_CONNECTED;
|
|
||||||
extern const wxEventType wxEVT_DIALUP_DISCONNECTED;
|
|
||||||
|
|
||||||
/* Generic command events */
|
|
||||||
/* Note: a click is a higher-level event than button down/up */
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LEFT_CLICK;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LEFT_DCLICK;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_RIGHT_CLICK;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_RIGHT_DCLICK;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_SET_FOCUS;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_KILL_FOCUS;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_ENTER;
|
|
||||||
|
|
||||||
/* Tree control event types */
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TREE_BEGIN_DRAG;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TREE_BEGIN_RDRAG;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TREE_END_LABEL_EDIT;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TREE_DELETE_ITEM;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TREE_GET_INFO;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TREE_SET_INFO;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDING;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSING;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGING;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TREE_KEY_DOWN;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TREE_ITEM_ACTIVATED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK;
|
|
||||||
|
|
||||||
/* List control event types */
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LIST_BEGIN_DRAG;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LIST_BEGIN_RDRAG;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LIST_END_LABEL_EDIT;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LIST_DELETE_ITEM;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LIST_GET_INFO;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LIST_SET_INFO;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LIST_ITEM_SELECTED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LIST_ITEM_DESELECTED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LIST_KEY_DOWN;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LIST_INSERT_ITEM;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LIST_COL_CLICK;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_LIST_ITEM_ACTIVATED;
|
|
||||||
|
|
||||||
/* Tab and notebook control event types */
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGING;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING;
|
|
||||||
|
|
||||||
/* Splitter events */
|
|
||||||
extern const wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_SPLITTER_DOUBLECLICKED;
|
|
||||||
extern const wxEventType wxEVT_COMMAND_SPLITTER_UNSPLIT;
|
|
||||||
|
|
||||||
/* Wizard events */
|
|
||||||
extern const wxEventType wxEVT_WIZARD_PAGE_CHANGED;
|
|
||||||
extern const wxEventType wxEVT_WIZARD_PAGE_CHANGING;
|
|
||||||
extern const wxEventType wxEVT_WIZARD_CANCEL;
|
|
||||||
|
|
||||||
/* Calendar events */
|
|
||||||
extern const wxEventType wxEVT_CALENDAR_SEL_CHANGED;
|
|
||||||
extern const wxEventType wxEVT_CALENDAR_DAY_CHANGED;
|
|
||||||
extern const wxEventType wxEVT_CALENDAR_MONTH_CHANGED;
|
|
||||||
extern const wxEventType wxEVT_CALENDAR_YEAR_CHANGED;
|
|
||||||
extern const wxEventType wxEVT_CALENDAR_DOUBLECLICKED;
|
|
||||||
extern const wxEventType wxEVT_CALENDAR_WEEKDAY_CLICKED;
|
|
||||||
|
|
||||||
/* Plot events */
|
|
||||||
extern const wxEventType wxEVT_PLOT_SEL_CHANGING;
|
|
||||||
extern const wxEventType wxEVT_PLOT_SEL_CHANGED;
|
|
||||||
extern const wxEventType wxEVT_PLOT_CLICKED;
|
|
||||||
extern const wxEventType wxEVT_PLOT_DOUBLECLICKED;
|
|
||||||
extern const wxEventType wxEVT_PLOT_ZOOM_IN;
|
|
||||||
extern const wxEventType wxEVT_PLOT_ZOOM_OUT;
|
|
||||||
extern const wxEventType wxEVT_PLOT_VALUE_SEL_CREATING;
|
|
||||||
extern const wxEventType wxEVT_PLOT_VALUE_SEL_CREATED;
|
|
||||||
extern const wxEventType wxEVT_PLOT_VALUE_SEL_CHANGING;
|
|
||||||
extern const wxEventType wxEVT_PLOT_VALUE_SEL_CHANGED;
|
|
||||||
extern const wxEventType wxEVT_PLOT_AREA_SEL_CREATING;
|
|
||||||
extern const wxEventType wxEVT_PLOT_AREA_SEL_CREATED;
|
|
||||||
extern const wxEventType wxEVT_PLOT_AREA_SEL_CHANGING;
|
|
||||||
extern const wxEventType wxEVT_PLOT_AREA_SEL_CHANGED;
|
|
||||||
extern const wxEventType wxEVT_PLOT_BEGIN_X_LABEL_EDIT;
|
|
||||||
extern const wxEventType wxEVT_PLOT_END_X_LABEL_EDIT;
|
|
||||||
extern const wxEventType wxEVT_PLOT_BEGIN_Y_LABEL_EDIT;
|
|
||||||
extern const wxEventType wxEVT_PLOT_END_Y_LABEL_EDIT;
|
|
||||||
extern const wxEventType wxEVT_PLOT_BEGIN_TITLE_EDIT;
|
|
||||||
extern const wxEventType wxEVT_PLOT_END_TITLE_EDIT;
|
|
||||||
|
|
||||||
extern const wxEventType wxEVT_USER_FIRST;
|
|
||||||
|
|
||||||
#else // everybody else
|
|
||||||
|
|
||||||
const wxEventType wxEVT_NULL = 0;
|
|
||||||
const wxEventType wxEVT_FIRST = 10000;
|
|
||||||
|
|
||||||
const wxEventType wxEVT_COMMAND_BUTTON_CLICKED = wxEVT_FIRST + 1;
|
|
||||||
const wxEventType wxEVT_COMMAND_CHECKBOX_CLICKED = wxEVT_FIRST + 2;
|
|
||||||
const wxEventType wxEVT_COMMAND_CHOICE_SELECTED = wxEVT_FIRST + 3;
|
|
||||||
const wxEventType wxEVT_COMMAND_LISTBOX_SELECTED = wxEVT_FIRST + 4;
|
|
||||||
const wxEventType wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = wxEVT_FIRST + 5;
|
|
||||||
const wxEventType wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = wxEVT_FIRST + 6;
|
|
||||||
const wxEventType wxEVT_COMMAND_TEXT_UPDATED = wxEVT_FIRST + 7;
|
|
||||||
const wxEventType wxEVT_COMMAND_TEXT_ENTER = wxEVT_FIRST + 8;
|
|
||||||
const wxEventType wxEVT_COMMAND_MENU_SELECTED = wxEVT_FIRST + 9;
|
|
||||||
const wxEventType wxEVT_COMMAND_TOOL_CLICKED = wxEVT_COMMAND_MENU_SELECTED;
|
|
||||||
const wxEventType wxEVT_COMMAND_SLIDER_UPDATED = wxEVT_FIRST + 10;
|
|
||||||
const wxEventType wxEVT_COMMAND_RADIOBOX_SELECTED = wxEVT_FIRST + 11;
|
|
||||||
const wxEventType wxEVT_COMMAND_RADIOBUTTON_SELECTED = wxEVT_FIRST + 12;
|
|
||||||
//const wxEventType wxEVT_COMMAND_SCROLLBAR_UPDATED is now obsolete since we use wxEVT_SCROLL... events
|
|
||||||
const wxEventType wxEVT_COMMAND_SCROLLBAR_UPDATED = wxEVT_FIRST + 13;
|
|
||||||
const wxEventType wxEVT_COMMAND_VLBOX_SELECTED = wxEVT_FIRST + 14;
|
|
||||||
const wxEventType wxEVT_COMMAND_COMBOBOX_SELECTED = wxEVT_FIRST + 15;
|
|
||||||
const wxEventType wxEVT_COMMAND_TOOL_RCLICKED = wxEVT_FIRST + 16;
|
|
||||||
const wxEventType wxEVT_COMMAND_TOOL_ENTER = wxEVT_FIRST + 17;
|
|
||||||
const wxEventType wxEVT_COMMAND_SPINCTRL_UPDATED = wxEVT_FIRST + 18;
|
|
||||||
|
|
||||||
/* Sockets send events, too */
|
|
||||||
const wxEventType wxEVT_SOCKET = wxEVT_FIRST + 50;
|
|
||||||
|
|
||||||
/* And timers do as well */
|
|
||||||
const wxEventType wxEVT_TIMER = wxEVT_FIRST + 80;
|
|
||||||
|
|
||||||
/* Mouse event types */
|
|
||||||
const wxEventType wxEVT_LEFT_DOWN = wxEVT_FIRST + 100;
|
|
||||||
const wxEventType wxEVT_LEFT_UP = wxEVT_FIRST + 101;
|
|
||||||
const wxEventType wxEVT_MIDDLE_DOWN = wxEVT_FIRST + 102;
|
|
||||||
const wxEventType wxEVT_MIDDLE_UP = wxEVT_FIRST + 103;
|
|
||||||
const wxEventType wxEVT_RIGHT_DOWN = wxEVT_FIRST + 104;
|
|
||||||
const wxEventType wxEVT_RIGHT_UP = wxEVT_FIRST + 105;
|
|
||||||
const wxEventType wxEVT_MOTION = wxEVT_FIRST + 106;
|
|
||||||
const wxEventType wxEVT_ENTER_WINDOW = wxEVT_FIRST + 107;
|
|
||||||
const wxEventType wxEVT_LEAVE_WINDOW = wxEVT_FIRST + 108;
|
|
||||||
const wxEventType wxEVT_LEFT_DCLICK = wxEVT_FIRST + 109;
|
|
||||||
const wxEventType wxEVT_MIDDLE_DCLICK = wxEVT_FIRST + 110;
|
|
||||||
const wxEventType wxEVT_RIGHT_DCLICK = wxEVT_FIRST + 111;
|
|
||||||
const wxEventType wxEVT_SET_FOCUS = wxEVT_FIRST + 112;
|
|
||||||
const wxEventType wxEVT_KILL_FOCUS = wxEVT_FIRST + 113;
|
|
||||||
|
|
||||||
/* Non-client mouse events */
|
|
||||||
const wxEventType wxEVT_NC_LEFT_DOWN = wxEVT_FIRST + 200;
|
|
||||||
const wxEventType wxEVT_NC_LEFT_UP = wxEVT_FIRST + 201;
|
|
||||||
const wxEventType wxEVT_NC_MIDDLE_DOWN = wxEVT_FIRST + 202;
|
|
||||||
const wxEventType wxEVT_NC_MIDDLE_UP = wxEVT_FIRST + 203;
|
|
||||||
const wxEventType wxEVT_NC_RIGHT_DOWN = wxEVT_FIRST + 204;
|
|
||||||
const wxEventType wxEVT_NC_RIGHT_UP = wxEVT_FIRST + 205;
|
|
||||||
const wxEventType wxEVT_NC_MOTION = wxEVT_FIRST + 206;
|
|
||||||
const wxEventType wxEVT_NC_ENTER_WINDOW = wxEVT_FIRST + 207;
|
|
||||||
const wxEventType wxEVT_NC_LEAVE_WINDOW = wxEVT_FIRST + 208;
|
|
||||||
const wxEventType wxEVT_NC_LEFT_DCLICK = wxEVT_FIRST + 209;
|
|
||||||
const wxEventType wxEVT_NC_MIDDLE_DCLICK = wxEVT_FIRST + 210;
|
|
||||||
const wxEventType wxEVT_NC_RIGHT_DCLICK = wxEVT_FIRST + 211;
|
|
||||||
|
|
||||||
/* Character input event type */
|
|
||||||
const wxEventType wxEVT_CHAR = wxEVT_FIRST + 212;
|
|
||||||
const wxEventType wxEVT_CHAR_HOOK = wxEVT_FIRST + 213;
|
|
||||||
const wxEventType wxEVT_NAVIGATION_KEY = wxEVT_FIRST + 214;
|
|
||||||
const wxEventType wxEVT_KEY_DOWN = wxEVT_FIRST + 215;
|
|
||||||
const wxEventType wxEVT_KEY_UP = wxEVT_FIRST + 216;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* wxScrollbar and wxSlider event identifiers
|
|
||||||
*/
|
|
||||||
const wxEventType wxEVT_SCROLL_TOP = wxEVT_FIRST + 300;
|
|
||||||
const wxEventType wxEVT_SCROLL_BOTTOM = wxEVT_FIRST + 301;
|
|
||||||
const wxEventType wxEVT_SCROLL_LINEUP = wxEVT_FIRST + 302;
|
|
||||||
const wxEventType wxEVT_SCROLL_LINEDOWN = wxEVT_FIRST + 303;
|
|
||||||
const wxEventType wxEVT_SCROLL_PAGEUP = wxEVT_FIRST + 304;
|
|
||||||
const wxEventType wxEVT_SCROLL_PAGEDOWN = wxEVT_FIRST + 305;
|
|
||||||
const wxEventType wxEVT_SCROLL_THUMBTRACK = wxEVT_FIRST + 306;
|
|
||||||
const wxEventType wxEVT_SCROLL_THUMBRELEASE = wxEVT_FIRST + 307;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Scroll events from wxWindow
|
|
||||||
*/
|
|
||||||
const wxEventType wxEVT_SCROLLWIN_TOP = wxEVT_FIRST + 320;
|
|
||||||
const wxEventType wxEVT_SCROLLWIN_BOTTOM = wxEVT_FIRST + 321;
|
|
||||||
const wxEventType wxEVT_SCROLLWIN_LINEUP = wxEVT_FIRST + 322;
|
|
||||||
const wxEventType wxEVT_SCROLLWIN_LINEDOWN = wxEVT_FIRST + 323;
|
|
||||||
const wxEventType wxEVT_SCROLLWIN_PAGEUP = wxEVT_FIRST + 324;
|
|
||||||
const wxEventType wxEVT_SCROLLWIN_PAGEDOWN = wxEVT_FIRST + 325;
|
|
||||||
const wxEventType wxEVT_SCROLLWIN_THUMBTRACK = wxEVT_FIRST + 326;
|
|
||||||
const wxEventType wxEVT_SCROLLWIN_THUMBRELEASE = wxEVT_FIRST + 327;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* System events
|
|
||||||
*/
|
|
||||||
const wxEventType wxEVT_SIZE = wxEVT_FIRST + 400;
|
|
||||||
const wxEventType wxEVT_MOVE = wxEVT_FIRST + 401;
|
|
||||||
const wxEventType wxEVT_CLOSE_WINDOW = wxEVT_FIRST + 402;
|
|
||||||
const wxEventType wxEVT_END_SESSION = wxEVT_FIRST + 403;
|
|
||||||
const wxEventType wxEVT_QUERY_END_SESSION = wxEVT_FIRST + 404;
|
|
||||||
const wxEventType wxEVT_ACTIVATE_APP = wxEVT_FIRST + 405;
|
|
||||||
const wxEventType wxEVT_POWER = wxEVT_FIRST + 406;
|
|
||||||
const wxEventType wxEVT_ACTIVATE = wxEVT_FIRST + 409;
|
|
||||||
const wxEventType wxEVT_CREATE = wxEVT_FIRST + 410;
|
|
||||||
const wxEventType wxEVT_DESTROY = wxEVT_FIRST + 411;
|
|
||||||
const wxEventType wxEVT_SHOW = wxEVT_FIRST + 412;
|
|
||||||
const wxEventType wxEVT_ICONIZE = wxEVT_FIRST + 413;
|
|
||||||
const wxEventType wxEVT_MAXIMIZE = wxEVT_FIRST + 414;
|
|
||||||
const wxEventType wxEVT_MOUSE_CAPTURE_CHANGED = wxEVT_FIRST + 415;
|
|
||||||
const wxEventType wxEVT_PAINT = wxEVT_FIRST + 416;
|
|
||||||
const wxEventType wxEVT_ERASE_BACKGROUND = wxEVT_FIRST + 417;
|
|
||||||
const wxEventType wxEVT_NC_PAINT = wxEVT_FIRST + 418;
|
|
||||||
const wxEventType wxEVT_PAINT_ICON = wxEVT_FIRST + 419;
|
|
||||||
const wxEventType wxEVT_MENU_CHAR = wxEVT_FIRST + 420;
|
|
||||||
const wxEventType wxEVT_MENU_INIT = wxEVT_FIRST + 421;
|
|
||||||
const wxEventType wxEVT_MENU_HIGHLIGHT = wxEVT_FIRST + 422;
|
|
||||||
const wxEventType wxEVT_POPUP_MENU_INIT = wxEVT_FIRST + 423;
|
|
||||||
const wxEventType wxEVT_CONTEXT_MENU = wxEVT_FIRST + 424;
|
|
||||||
const wxEventType wxEVT_SYS_COLOUR_CHANGED = wxEVT_FIRST + 425;
|
|
||||||
const wxEventType wxEVT_SETTING_CHANGED = wxEVT_FIRST + 426;
|
|
||||||
const wxEventType wxEVT_QUERY_NEW_PALETTE = wxEVT_FIRST + 427;
|
|
||||||
const wxEventType wxEVT_PALETTE_CHANGED = wxEVT_FIRST + 428;
|
|
||||||
const wxEventType wxEVT_JOY_BUTTON_DOWN = wxEVT_FIRST + 429;
|
|
||||||
const wxEventType wxEVT_JOY_BUTTON_UP = wxEVT_FIRST + 430;
|
|
||||||
const wxEventType wxEVT_JOY_MOVE = wxEVT_FIRST + 431;
|
|
||||||
const wxEventType wxEVT_JOY_ZMOVE = wxEVT_FIRST + 432;
|
|
||||||
const wxEventType wxEVT_DROP_FILES = wxEVT_FIRST + 433;
|
|
||||||
const wxEventType wxEVT_DRAW_ITEM = wxEVT_FIRST + 434;
|
|
||||||
const wxEventType wxEVT_MEASURE_ITEM = wxEVT_FIRST + 435;
|
|
||||||
const wxEventType wxEVT_COMPARE_ITEM = wxEVT_FIRST + 436;
|
|
||||||
const wxEventType wxEVT_INIT_DIALOG = wxEVT_FIRST + 437;
|
|
||||||
const wxEventType wxEVT_IDLE = wxEVT_FIRST + 438;
|
|
||||||
const wxEventType wxEVT_UPDATE_UI = wxEVT_FIRST + 439;
|
|
||||||
|
|
||||||
/* System misc. */
|
|
||||||
const wxEventType wxEVT_END_PROCESS = wxEVT_FIRST + 440;
|
|
||||||
|
|
||||||
/* Dial up events */
|
|
||||||
const wxEventType wxEVT_DIALUP_CONNECTED = wxEVT_FIRST + 450;
|
|
||||||
const wxEventType wxEVT_DIALUP_DISCONNECTED = wxEVT_FIRST + 451;
|
|
||||||
|
|
||||||
/* Generic command events */
|
|
||||||
/* Note: a click is a higher-level event than button down/up */
|
|
||||||
const wxEventType wxEVT_COMMAND_LEFT_CLICK = wxEVT_FIRST + 500;
|
|
||||||
const wxEventType wxEVT_COMMAND_LEFT_DCLICK = wxEVT_FIRST + 501;
|
|
||||||
const wxEventType wxEVT_COMMAND_RIGHT_CLICK = wxEVT_FIRST + 502;
|
|
||||||
const wxEventType wxEVT_COMMAND_RIGHT_DCLICK = wxEVT_FIRST + 503;
|
|
||||||
const wxEventType wxEVT_COMMAND_SET_FOCUS = wxEVT_FIRST + 504;
|
|
||||||
const wxEventType wxEVT_COMMAND_KILL_FOCUS = wxEVT_FIRST + 505;
|
|
||||||
const wxEventType wxEVT_COMMAND_ENTER = wxEVT_FIRST + 506;
|
|
||||||
|
|
||||||
/* Tree control event types */
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_BEGIN_DRAG = wxEVT_FIRST + 600;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_BEGIN_RDRAG = wxEVT_FIRST + 601;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT = wxEVT_FIRST + 602;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_END_LABEL_EDIT = wxEVT_FIRST + 603;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_DELETE_ITEM = wxEVT_FIRST + 604;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_GET_INFO = wxEVT_FIRST + 605;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_SET_INFO = wxEVT_FIRST + 606;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDED = wxEVT_FIRST + 607;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDING = wxEVT_FIRST + 608;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSED = wxEVT_FIRST + 609;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSING = wxEVT_FIRST + 610;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGED = wxEVT_FIRST + 611;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGING = wxEVT_FIRST + 612;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_KEY_DOWN = wxEVT_FIRST + 613;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_ITEM_ACTIVATED = wxEVT_FIRST + 614;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK = wxEVT_FIRST + 615;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK = wxEVT_FIRST + 616;
|
|
||||||
|
|
||||||
/* List control event types */
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_BEGIN_DRAG = wxEVT_FIRST + 700;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_BEGIN_RDRAG = wxEVT_FIRST + 701;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT = wxEVT_FIRST + 702;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_END_LABEL_EDIT = wxEVT_FIRST + 703;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_DELETE_ITEM = wxEVT_FIRST + 704;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS = wxEVT_FIRST + 705;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_GET_INFO = wxEVT_FIRST + 706;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_SET_INFO = wxEVT_FIRST + 707;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_ITEM_SELECTED = wxEVT_FIRST + 708;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_ITEM_DESELECTED = wxEVT_FIRST + 709;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_KEY_DOWN = wxEVT_FIRST + 710;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_INSERT_ITEM = wxEVT_FIRST + 711;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_COL_CLICK = wxEVT_FIRST + 712;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK = wxEVT_FIRST + 713;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK = wxEVT_FIRST + 714;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_ITEM_ACTIVATED = wxEVT_FIRST + 715;
|
|
||||||
|
|
||||||
/* Tab and notebook control event types */
|
|
||||||
const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGED = wxEVT_FIRST + 800;
|
|
||||||
const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGING = wxEVT_FIRST + 801;
|
|
||||||
|
|
||||||
#if defined(__BORLANDC__) && defined(__WIN16__)
|
#if defined(__BORLANDC__) && defined(__WIN16__)
|
||||||
/* For 16-bit BC++, these 2 are identical (truncated) */
|
// For 16-bit BC++, these 2 would be identical otherwise (truncated)
|
||||||
const wxEventType wxEVT_COMMAND_NB_PAGE_CHANGED = wxEVT_FIRST + 802;
|
#define wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED wxEVT_COMMAND_NB_PAGE_CHANGED
|
||||||
const wxEventType wxEVT_COMMAND_NB_PAGE_CHANGING = wxEVT_FIRST + 803;
|
#define wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING wxEVT_COMMAND_NB_PAGE_CHANGING
|
||||||
#else
|
|
||||||
const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED = wxEVT_FIRST + 802;
|
|
||||||
const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING = wxEVT_FIRST + 803;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Splitter events */
|
typedef int wxEventType;
|
||||||
const wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED = wxEVT_FIRST + 850;
|
|
||||||
const wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING = wxEVT_FIRST + 851;
|
|
||||||
const wxEventType wxEVT_COMMAND_SPLITTER_DOUBLECLICKED = wxEVT_FIRST + 852;
|
|
||||||
const wxEventType wxEVT_COMMAND_SPLITTER_UNSPLIT = wxEVT_FIRST + 853;
|
|
||||||
|
|
||||||
/* Wizard events */
|
// the standard event types
|
||||||
const wxEventType wxEVT_WIZARD_PAGE_CHANGED = wxEVT_FIRST + 900;
|
enum
|
||||||
const wxEventType wxEVT_WIZARD_PAGE_CHANGING = wxEVT_FIRST + 901;
|
{
|
||||||
const wxEventType wxEVT_WIZARD_CANCEL = wxEVT_FIRST + 902;
|
wxEVT_NULL = 0,
|
||||||
|
wxEVT_FIRST = 10000,
|
||||||
|
|
||||||
/* Calendar events */
|
wxEVT_COMMAND_BUTTON_CLICKED = wxEVT_FIRST + 1,
|
||||||
const wxEventType wxEVT_CALENDAR_SEL_CHANGED = wxEVT_FIRST + 950;
|
wxEVT_COMMAND_CHECKBOX_CLICKED = wxEVT_FIRST + 2,
|
||||||
const wxEventType wxEVT_CALENDAR_DAY_CHANGED = wxEVT_FIRST + 951;
|
wxEVT_COMMAND_CHOICE_SELECTED = wxEVT_FIRST + 3,
|
||||||
const wxEventType wxEVT_CALENDAR_MONTH_CHANGED = wxEVT_FIRST + 952;
|
wxEVT_COMMAND_LISTBOX_SELECTED = wxEVT_FIRST + 4,
|
||||||
const wxEventType wxEVT_CALENDAR_YEAR_CHANGED = wxEVT_FIRST + 953;
|
wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = wxEVT_FIRST + 5,
|
||||||
const wxEventType wxEVT_CALENDAR_DOUBLECLICKED = wxEVT_FIRST + 954;
|
wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = wxEVT_FIRST + 6,
|
||||||
const wxEventType wxEVT_CALENDAR_WEEKDAY_CLICKED = wxEVT_FIRST + 955;
|
wxEVT_COMMAND_TEXT_UPDATED = wxEVT_FIRST + 7,
|
||||||
|
wxEVT_COMMAND_TEXT_ENTER = wxEVT_FIRST + 8,
|
||||||
|
wxEVT_COMMAND_MENU_SELECTED = wxEVT_FIRST + 9,
|
||||||
|
wxEVT_COMMAND_TOOL_CLICKED = wxEVT_COMMAND_MENU_SELECTED,
|
||||||
|
wxEVT_COMMAND_SLIDER_UPDATED = wxEVT_FIRST + 10,
|
||||||
|
wxEVT_COMMAND_RADIOBOX_SELECTED = wxEVT_FIRST + 11,
|
||||||
|
wxEVT_COMMAND_RADIOBUTTON_SELECTED = wxEVT_FIRST + 12,
|
||||||
|
//wxEVT_COMMAND_SCROLLBAR_UPDATED is now obsolete since we use wxEVT_SCROLL... events
|
||||||
|
wxEVT_COMMAND_SCROLLBAR_UPDATED = wxEVT_FIRST + 13,
|
||||||
|
wxEVT_COMMAND_VLBOX_SELECTED = wxEVT_FIRST + 14,
|
||||||
|
wxEVT_COMMAND_COMBOBOX_SELECTED = wxEVT_FIRST + 15,
|
||||||
|
wxEVT_COMMAND_TOOL_RCLICKED = wxEVT_FIRST + 16,
|
||||||
|
wxEVT_COMMAND_TOOL_ENTER = wxEVT_FIRST + 17,
|
||||||
|
wxEVT_COMMAND_SPINCTRL_UPDATED = wxEVT_FIRST + 18,
|
||||||
|
|
||||||
/* Plot events */
|
/* Sockets and timers send events, too */
|
||||||
const wxEventType wxEVT_PLOT_SEL_CHANGING = wxEVT_FIRST + 1000;
|
wxEVT_SOCKET = wxEVT_FIRST + 50,
|
||||||
const wxEventType wxEVT_PLOT_SEL_CHANGED = wxEVT_FIRST + 1001;
|
wxEVT_TIMER = wxEVT_FIRST + 80,
|
||||||
const wxEventType wxEVT_PLOT_CLICKED = wxEVT_FIRST + 1002;
|
|
||||||
const wxEventType wxEVT_PLOT_DOUBLECLICKED = wxEVT_FIRST + 1003;
|
|
||||||
const wxEventType wxEVT_PLOT_ZOOM_IN = wxEVT_FIRST + 1004;
|
|
||||||
const wxEventType wxEVT_PLOT_ZOOM_OUT = wxEVT_FIRST + 1005;
|
|
||||||
const wxEventType wxEVT_PLOT_VALUE_SEL_CREATING = wxEVT_FIRST + 1010;
|
|
||||||
const wxEventType wxEVT_PLOT_VALUE_SEL_CREATED = wxEVT_FIRST + 1011;
|
|
||||||
const wxEventType wxEVT_PLOT_VALUE_SEL_CHANGING = wxEVT_FIRST + 1012;
|
|
||||||
const wxEventType wxEVT_PLOT_VALUE_SEL_CHANGED = wxEVT_FIRST + 1013;
|
|
||||||
const wxEventType wxEVT_PLOT_AREA_SEL_CREATING = wxEVT_FIRST + 1014;
|
|
||||||
const wxEventType wxEVT_PLOT_AREA_SEL_CREATED = wxEVT_FIRST + 1015;
|
|
||||||
const wxEventType wxEVT_PLOT_AREA_SEL_CHANGING = wxEVT_FIRST + 1016;
|
|
||||||
const wxEventType wxEVT_PLOT_AREA_SEL_CHANGED = wxEVT_FIRST + 1017;
|
|
||||||
const wxEventType wxEVT_PLOT_BEGIN_X_LABEL_EDIT = wxEVT_FIRST + 1020;
|
|
||||||
const wxEventType wxEVT_PLOT_END_X_LABEL_EDIT = wxEVT_FIRST + 1021;
|
|
||||||
const wxEventType wxEVT_PLOT_BEGIN_Y_LABEL_EDIT = wxEVT_FIRST + 1022;
|
|
||||||
const wxEventType wxEVT_PLOT_END_Y_LABEL_EDIT = wxEVT_FIRST + 1023;
|
|
||||||
const wxEventType wxEVT_PLOT_BEGIN_TITLE_EDIT = wxEVT_FIRST + 1024;
|
|
||||||
const wxEventType wxEVT_PLOT_END_TITLE_EDIT = wxEVT_FIRST + 1025;
|
|
||||||
|
|
||||||
const wxEventType wxEVT_USER_FIRST = wxEVT_FIRST + 2000;
|
/* Mouse event types */
|
||||||
|
wxEVT_LEFT_DOWN = wxEVT_FIRST + 100,
|
||||||
|
wxEVT_LEFT_UP = wxEVT_FIRST + 101,
|
||||||
|
wxEVT_MIDDLE_DOWN = wxEVT_FIRST + 102,
|
||||||
|
wxEVT_MIDDLE_UP = wxEVT_FIRST + 103,
|
||||||
|
wxEVT_RIGHT_DOWN = wxEVT_FIRST + 104,
|
||||||
|
wxEVT_RIGHT_UP = wxEVT_FIRST + 105,
|
||||||
|
wxEVT_MOTION = wxEVT_FIRST + 106,
|
||||||
|
wxEVT_ENTER_WINDOW = wxEVT_FIRST + 107,
|
||||||
|
wxEVT_LEAVE_WINDOW = wxEVT_FIRST + 108,
|
||||||
|
wxEVT_LEFT_DCLICK = wxEVT_FIRST + 109,
|
||||||
|
wxEVT_MIDDLE_DCLICK = wxEVT_FIRST + 110,
|
||||||
|
wxEVT_RIGHT_DCLICK = wxEVT_FIRST + 111,
|
||||||
|
wxEVT_SET_FOCUS = wxEVT_FIRST + 112,
|
||||||
|
wxEVT_KILL_FOCUS = wxEVT_FIRST + 113,
|
||||||
|
|
||||||
#endif // for VisualAge C++ V4.0
|
/* Non-client mouse events */
|
||||||
|
wxEVT_NC_LEFT_DOWN = wxEVT_FIRST + 200,
|
||||||
|
wxEVT_NC_LEFT_UP = wxEVT_FIRST + 201,
|
||||||
|
wxEVT_NC_MIDDLE_DOWN = wxEVT_FIRST + 202,
|
||||||
|
wxEVT_NC_MIDDLE_UP = wxEVT_FIRST + 203,
|
||||||
|
wxEVT_NC_RIGHT_DOWN = wxEVT_FIRST + 204,
|
||||||
|
wxEVT_NC_RIGHT_UP = wxEVT_FIRST + 205,
|
||||||
|
wxEVT_NC_MOTION = wxEVT_FIRST + 206,
|
||||||
|
wxEVT_NC_ENTER_WINDOW = wxEVT_FIRST + 207,
|
||||||
|
wxEVT_NC_LEAVE_WINDOW = wxEVT_FIRST + 208,
|
||||||
|
wxEVT_NC_LEFT_DCLICK = wxEVT_FIRST + 209,
|
||||||
|
wxEVT_NC_MIDDLE_DCLICK = wxEVT_FIRST + 210,
|
||||||
|
wxEVT_NC_RIGHT_DCLICK = wxEVT_FIRST + 211,
|
||||||
|
|
||||||
|
/* Character input event type */
|
||||||
|
wxEVT_CHAR = wxEVT_FIRST + 212,
|
||||||
|
wxEVT_CHAR_HOOK = wxEVT_FIRST + 213,
|
||||||
|
wxEVT_NAVIGATION_KEY = wxEVT_FIRST + 214,
|
||||||
|
wxEVT_KEY_DOWN = wxEVT_FIRST + 215,
|
||||||
|
wxEVT_KEY_UP = wxEVT_FIRST + 216,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* wxScrollbar and wxSlider event identifiers
|
||||||
|
*/
|
||||||
|
wxEVT_SCROLL_TOP = wxEVT_FIRST + 300,
|
||||||
|
wxEVT_SCROLL_BOTTOM = wxEVT_FIRST + 301,
|
||||||
|
wxEVT_SCROLL_LINEUP = wxEVT_FIRST + 302,
|
||||||
|
wxEVT_SCROLL_LINEDOWN = wxEVT_FIRST + 303,
|
||||||
|
wxEVT_SCROLL_PAGEUP = wxEVT_FIRST + 304,
|
||||||
|
wxEVT_SCROLL_PAGEDOWN = wxEVT_FIRST + 305,
|
||||||
|
wxEVT_SCROLL_THUMBTRACK = wxEVT_FIRST + 306,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Scroll events from wxWindow
|
||||||
|
*/
|
||||||
|
wxEVT_SCROLLWIN_TOP = wxEVT_FIRST + 320,
|
||||||
|
wxEVT_SCROLLWIN_BOTTOM = wxEVT_FIRST + 321,
|
||||||
|
wxEVT_SCROLLWIN_LINEUP = wxEVT_FIRST + 322,
|
||||||
|
wxEVT_SCROLLWIN_LINEDOWN = wxEVT_FIRST + 323,
|
||||||
|
wxEVT_SCROLLWIN_PAGEUP = wxEVT_FIRST + 324,
|
||||||
|
wxEVT_SCROLLWIN_PAGEDOWN = wxEVT_FIRST + 325,
|
||||||
|
wxEVT_SCROLLWIN_THUMBTRACK = wxEVT_FIRST + 326,
|
||||||
|
wxEVT_SCROLL_THUMBRELEASE = wxEVT_FIRST + 327,
|
||||||
|
|
||||||
|
/*
|
||||||
|
* System events
|
||||||
|
*/
|
||||||
|
wxEVT_SIZE = wxEVT_FIRST + 400,
|
||||||
|
wxEVT_MOVE = wxEVT_FIRST + 401,
|
||||||
|
wxEVT_CLOSE_WINDOW = wxEVT_FIRST + 402,
|
||||||
|
wxEVT_END_SESSION = wxEVT_FIRST + 403,
|
||||||
|
wxEVT_QUERY_END_SESSION = wxEVT_FIRST + 404,
|
||||||
|
wxEVT_ACTIVATE_APP = wxEVT_FIRST + 405,
|
||||||
|
wxEVT_POWER = wxEVT_FIRST + 406,
|
||||||
|
wxEVT_ACTIVATE = wxEVT_FIRST + 409,
|
||||||
|
wxEVT_CREATE = wxEVT_FIRST + 410,
|
||||||
|
wxEVT_DESTROY = wxEVT_FIRST + 411,
|
||||||
|
wxEVT_SHOW = wxEVT_FIRST + 412,
|
||||||
|
wxEVT_ICONIZE = wxEVT_FIRST + 413,
|
||||||
|
wxEVT_MAXIMIZE = wxEVT_FIRST + 414,
|
||||||
|
wxEVT_MOUSE_CAPTURE_CHANGED = wxEVT_FIRST + 415,
|
||||||
|
wxEVT_PAINT = wxEVT_FIRST + 416,
|
||||||
|
wxEVT_ERASE_BACKGROUND = wxEVT_FIRST + 417,
|
||||||
|
wxEVT_NC_PAINT = wxEVT_FIRST + 418,
|
||||||
|
wxEVT_PAINT_ICON = wxEVT_FIRST + 419,
|
||||||
|
wxEVT_MENU_CHAR = wxEVT_FIRST + 420,
|
||||||
|
wxEVT_MENU_INIT = wxEVT_FIRST + 421,
|
||||||
|
wxEVT_MENU_HIGHLIGHT = wxEVT_FIRST + 422,
|
||||||
|
wxEVT_POPUP_MENU_INIT = wxEVT_FIRST + 423,
|
||||||
|
wxEVT_CONTEXT_MENU = wxEVT_FIRST + 424,
|
||||||
|
wxEVT_SYS_COLOUR_CHANGED = wxEVT_FIRST + 425,
|
||||||
|
wxEVT_SETTING_CHANGED = wxEVT_FIRST + 426,
|
||||||
|
wxEVT_QUERY_NEW_PALETTE = wxEVT_FIRST + 427,
|
||||||
|
wxEVT_PALETTE_CHANGED = wxEVT_FIRST + 428,
|
||||||
|
wxEVT_JOY_BUTTON_DOWN = wxEVT_FIRST + 429,
|
||||||
|
wxEVT_JOY_BUTTON_UP = wxEVT_FIRST + 430,
|
||||||
|
wxEVT_JOY_MOVE = wxEVT_FIRST + 431,
|
||||||
|
wxEVT_JOY_ZMOVE = wxEVT_FIRST + 432,
|
||||||
|
wxEVT_DROP_FILES = wxEVT_FIRST + 433,
|
||||||
|
wxEVT_DRAW_ITEM = wxEVT_FIRST + 434,
|
||||||
|
wxEVT_MEASURE_ITEM = wxEVT_FIRST + 435,
|
||||||
|
wxEVT_COMPARE_ITEM = wxEVT_FIRST + 436,
|
||||||
|
wxEVT_INIT_DIALOG = wxEVT_FIRST + 437,
|
||||||
|
wxEVT_IDLE = wxEVT_FIRST + 438,
|
||||||
|
wxEVT_UPDATE_UI = wxEVT_FIRST + 439,
|
||||||
|
|
||||||
|
/* System misc. */
|
||||||
|
wxEVT_END_PROCESS = wxEVT_FIRST + 440,
|
||||||
|
|
||||||
|
/* Dial up events */
|
||||||
|
wxEVT_DIALUP_CONNECTED = wxEVT_FIRST + 450,
|
||||||
|
wxEVT_DIALUP_DISCONNECTED = wxEVT_FIRST + 451,
|
||||||
|
|
||||||
|
/* Generic command events */
|
||||||
|
/* Note: a click is a higher-level event than button down/up */
|
||||||
|
wxEVT_COMMAND_LEFT_CLICK = wxEVT_FIRST + 500,
|
||||||
|
wxEVT_COMMAND_LEFT_DCLICK = wxEVT_FIRST + 501,
|
||||||
|
wxEVT_COMMAND_RIGHT_CLICK = wxEVT_FIRST + 502,
|
||||||
|
wxEVT_COMMAND_RIGHT_DCLICK = wxEVT_FIRST + 503,
|
||||||
|
wxEVT_COMMAND_SET_FOCUS = wxEVT_FIRST + 504,
|
||||||
|
wxEVT_COMMAND_KILL_FOCUS = wxEVT_FIRST + 505,
|
||||||
|
wxEVT_COMMAND_ENTER = wxEVT_FIRST + 506,
|
||||||
|
|
||||||
|
/* Tree control event types */
|
||||||
|
wxEVT_COMMAND_TREE_BEGIN_DRAG = wxEVT_FIRST + 600,
|
||||||
|
wxEVT_COMMAND_TREE_BEGIN_RDRAG = wxEVT_FIRST + 601,
|
||||||
|
wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT = wxEVT_FIRST + 602,
|
||||||
|
wxEVT_COMMAND_TREE_END_LABEL_EDIT = wxEVT_FIRST + 603,
|
||||||
|
wxEVT_COMMAND_TREE_DELETE_ITEM = wxEVT_FIRST + 604,
|
||||||
|
wxEVT_COMMAND_TREE_GET_INFO = wxEVT_FIRST + 605,
|
||||||
|
wxEVT_COMMAND_TREE_SET_INFO = wxEVT_FIRST + 606,
|
||||||
|
wxEVT_COMMAND_TREE_ITEM_EXPANDED = wxEVT_FIRST + 607,
|
||||||
|
wxEVT_COMMAND_TREE_ITEM_EXPANDING = wxEVT_FIRST + 608,
|
||||||
|
wxEVT_COMMAND_TREE_ITEM_COLLAPSED = wxEVT_FIRST + 609,
|
||||||
|
wxEVT_COMMAND_TREE_ITEM_COLLAPSING = wxEVT_FIRST + 610,
|
||||||
|
wxEVT_COMMAND_TREE_SEL_CHANGED = wxEVT_FIRST + 611,
|
||||||
|
wxEVT_COMMAND_TREE_SEL_CHANGING = wxEVT_FIRST + 612,
|
||||||
|
wxEVT_COMMAND_TREE_KEY_DOWN = wxEVT_FIRST + 613,
|
||||||
|
wxEVT_COMMAND_TREE_ITEM_ACTIVATED = wxEVT_FIRST + 614,
|
||||||
|
wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK = wxEVT_FIRST + 615,
|
||||||
|
wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK = wxEVT_FIRST + 616,
|
||||||
|
wxEVT_COMMAND_TREE_END_DRAG = wxEVT_FIRST + 617,
|
||||||
|
|
||||||
|
/* List control event types */
|
||||||
|
wxEVT_COMMAND_LIST_BEGIN_DRAG = wxEVT_FIRST + 700,
|
||||||
|
wxEVT_COMMAND_LIST_BEGIN_RDRAG = wxEVT_FIRST + 701,
|
||||||
|
wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT = wxEVT_FIRST + 702,
|
||||||
|
wxEVT_COMMAND_LIST_END_LABEL_EDIT = wxEVT_FIRST + 703,
|
||||||
|
wxEVT_COMMAND_LIST_DELETE_ITEM = wxEVT_FIRST + 704,
|
||||||
|
wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS = wxEVT_FIRST + 705,
|
||||||
|
wxEVT_COMMAND_LIST_GET_INFO = wxEVT_FIRST + 706,
|
||||||
|
wxEVT_COMMAND_LIST_SET_INFO = wxEVT_FIRST + 707,
|
||||||
|
wxEVT_COMMAND_LIST_ITEM_SELECTED = wxEVT_FIRST + 708,
|
||||||
|
wxEVT_COMMAND_LIST_ITEM_DESELECTED = wxEVT_FIRST + 709,
|
||||||
|
wxEVT_COMMAND_LIST_KEY_DOWN = wxEVT_FIRST + 710,
|
||||||
|
wxEVT_COMMAND_LIST_INSERT_ITEM = wxEVT_FIRST + 711,
|
||||||
|
wxEVT_COMMAND_LIST_COL_CLICK = wxEVT_FIRST + 712,
|
||||||
|
wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK = wxEVT_FIRST + 713,
|
||||||
|
wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK = wxEVT_FIRST + 714,
|
||||||
|
wxEVT_COMMAND_LIST_ITEM_ACTIVATED = wxEVT_FIRST + 715,
|
||||||
|
|
||||||
|
/* Tab and notebook control event types */
|
||||||
|
wxEVT_COMMAND_TAB_SEL_CHANGED = wxEVT_FIRST + 800,
|
||||||
|
wxEVT_COMMAND_TAB_SEL_CHANGING = wxEVT_FIRST + 801,
|
||||||
|
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED = wxEVT_FIRST + 802,
|
||||||
|
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING = wxEVT_FIRST + 803,
|
||||||
|
|
||||||
|
/* Splitter events */
|
||||||
|
wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED = wxEVT_FIRST + 850,
|
||||||
|
wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING = wxEVT_FIRST + 851,
|
||||||
|
wxEVT_COMMAND_SPLITTER_DOUBLECLICKED = wxEVT_FIRST + 852,
|
||||||
|
wxEVT_COMMAND_SPLITTER_UNSPLIT = wxEVT_FIRST + 853,
|
||||||
|
|
||||||
|
/* Wizard events */
|
||||||
|
wxEVT_WIZARD_PAGE_CHANGED = wxEVT_FIRST + 900,
|
||||||
|
wxEVT_WIZARD_PAGE_CHANGING = wxEVT_FIRST + 901,
|
||||||
|
wxEVT_WIZARD_CANCEL = wxEVT_FIRST + 902,
|
||||||
|
|
||||||
|
/* Calendar events */
|
||||||
|
wxEVT_CALENDAR_SEL_CHANGED = wxEVT_FIRST + 950,
|
||||||
|
wxEVT_CALENDAR_DAY_CHANGED = wxEVT_FIRST + 951,
|
||||||
|
wxEVT_CALENDAR_MONTH_CHANGED = wxEVT_FIRST + 952,
|
||||||
|
wxEVT_CALENDAR_YEAR_CHANGED = wxEVT_FIRST + 953,
|
||||||
|
wxEVT_CALENDAR_DOUBLECLICKED = wxEVT_FIRST + 954,
|
||||||
|
wxEVT_CALENDAR_WEEKDAY_CLICKED = wxEVT_FIRST + 955,
|
||||||
|
|
||||||
|
wxEVT_USER_FIRST = wxEVT_FIRST + 2000
|
||||||
|
};
|
||||||
|
|
||||||
/* Compatibility */
|
/* Compatibility */
|
||||||
|
|
||||||
@@ -704,9 +444,12 @@ public:
|
|||||||
wxNotifyEvent(wxEventType commandType = wxEVT_NULL, int id = 0)
|
wxNotifyEvent(wxEventType commandType = wxEVT_NULL, int id = 0)
|
||||||
: wxCommandEvent(commandType, id) { m_bAllow = TRUE; }
|
: wxCommandEvent(commandType, id) { m_bAllow = TRUE; }
|
||||||
|
|
||||||
// veto the operation (by default it's allowed)
|
// veto the operation (usually it's allowed by default)
|
||||||
void Veto() { m_bAllow = FALSE; }
|
void Veto() { m_bAllow = FALSE; }
|
||||||
|
|
||||||
|
// allow the operation if it was disabled by default
|
||||||
|
void Allow() { m_bAllow = TRUE; }
|
||||||
|
|
||||||
// for implementation code only: is the operation allowed?
|
// for implementation code only: is the operation allowed?
|
||||||
bool IsAllowed() const { return m_bAllow; }
|
bool IsAllowed() const { return m_bAllow; }
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: dragimag.h
|
// Name: wx/msw/dragimag.h
|
||||||
// Purpose: wxDragImage class: a kind of a cursor, that can cope
|
// Purpose: wxDragImage class: a kind of a cursor, that can cope
|
||||||
// with more sophisticated images
|
// with more sophisticated images
|
||||||
// Author: Julian Smart
|
// Author: Julian Smart
|
||||||
@@ -100,7 +100,6 @@
|
|||||||
|
|
||||||
class WXDLLEXPORT wxDragImage: public wxObject
|
class WXDLLEXPORT wxDragImage: public wxObject
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxDragImage)
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Ctors & dtor
|
// Ctors & dtor
|
||||||
@@ -176,13 +175,16 @@ public:
|
|||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Returns the native image list handle
|
// Returns the native image list handle
|
||||||
inline WXHIMAGELIST GetHIMAGELIST() const { return m_hImageList; }
|
WXHIMAGELIST GetHIMAGELIST() const { return m_hImageList; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
WXHIMAGELIST m_hImageList;
|
WXHIMAGELIST m_hImageList;
|
||||||
wxCursor m_cursor;
|
wxCursor m_cursor;
|
||||||
wxPoint m_hotspot;
|
wxPoint m_hotspot;
|
||||||
wxPoint m_position;
|
wxPoint m_position;
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxDragImage)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -56,7 +56,8 @@ public:
|
|||||||
// (with environment variable references)
|
// (with environment variable references)
|
||||||
Type_Binary, // Free form binary
|
Type_Binary, // Free form binary
|
||||||
Type_Dword, // 32-bit number
|
Type_Dword, // 32-bit number
|
||||||
Type_Dword_little_endian, // 32-bit number (same as Type_DWORD)
|
Type_Dword_little_endian // 32-bit number
|
||||||
|
= Type_Dword, // (same as Type_DWORD)
|
||||||
Type_Dword_big_endian, // 32-bit number
|
Type_Dword_big_endian, // 32-bit number
|
||||||
Type_Link, // Symbolic Link (unicode)
|
Type_Link, // Symbolic Link (unicode)
|
||||||
Type_Multi_String, // Multiple Unicode strings
|
Type_Multi_String, // Multiple Unicode strings
|
||||||
@@ -71,13 +72,15 @@ public:
|
|||||||
{
|
{
|
||||||
HKCR // classes root
|
HKCR // classes root
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
, HKCU, // current user
|
,
|
||||||
|
HKCU, // current user
|
||||||
HKLM, // local machine
|
HKLM, // local machine
|
||||||
HKUSR, // users
|
HKUSR, // users
|
||||||
HKPD // performance data (@@ NT only?)
|
HKPD // performance data (WinNT/2K only)
|
||||||
#if WINVER >= 0x0400
|
#if WINVER >= 0x0400
|
||||||
, HKCC, // current config
|
,
|
||||||
HKDD // dynamic data
|
HKCC, // current config (starting from Win95/NT 4.0)
|
||||||
|
HKDD // dynamic data (Win95/98 only)
|
||||||
#endif // Winver
|
#endif // Winver
|
||||||
#endif // Win32/16
|
#endif // Win32/16
|
||||||
};
|
};
|
||||||
@@ -124,18 +127,10 @@ public:
|
|||||||
// return true if the key exists
|
// return true if the key exists
|
||||||
bool Exists() const;
|
bool Exists() const;
|
||||||
// get the info about key (any number of these pointers may be NULL)
|
// get the info about key (any number of these pointers may be NULL)
|
||||||
|
|
||||||
#if defined( __GNUWIN32_OLD__ )
|
|
||||||
bool GetKeyInfo(size_t *pnSubKeys, // number of subkeys
|
bool GetKeyInfo(size_t *pnSubKeys, // number of subkeys
|
||||||
size_t *pnMaxKeyLen, // max len of subkey name
|
size_t *pnMaxKeyLen, // max len of subkey name
|
||||||
size_t *pnValues, // number of values
|
size_t *pnValues, // number of values
|
||||||
size_t *pnMaxValueLen) const;
|
size_t *pnMaxValueLen) const;
|
||||||
#else
|
|
||||||
bool GetKeyInfo(ulong *pnSubKeys, // number of subkeys
|
|
||||||
ulong *pnMaxKeyLen, // max len of subkey name
|
|
||||||
ulong *pnValues, // number of values
|
|
||||||
ulong *pnMaxValueLen) const;
|
|
||||||
#endif
|
|
||||||
// return true if the key is opened
|
// return true if the key is opened
|
||||||
bool IsOpened() const { return m_hKey != 0; }
|
bool IsOpened() const { return m_hKey != 0; }
|
||||||
// for "if ( !key ) wxLogError(...)" kind of expressions
|
// for "if ( !key ) wxLogError(...)" kind of expressions
|
||||||
@@ -145,8 +140,18 @@ public:
|
|||||||
// explicitly open the key (will be automatically done by all functions
|
// explicitly open the key (will be automatically done by all functions
|
||||||
// which need the key to be opened if the key is not opened yet)
|
// which need the key to be opened if the key is not opened yet)
|
||||||
bool Open();
|
bool Open();
|
||||||
// create the key: will fail if the key already exists and bOkIfExists
|
// create the key: will fail if the key already exists and !bOkIfExists
|
||||||
bool Create(bool bOkIfExists = TRUE);
|
bool Create(bool bOkIfExists = TRUE);
|
||||||
|
// rename a value from old name to new one
|
||||||
|
bool RenameValue(const wxChar *szValueOld, const wxChar *szValueNew);
|
||||||
|
// copy value to another key possibly changing its name (by default it will
|
||||||
|
// remain the same)
|
||||||
|
bool CopyValue(const wxChar *szValue, wxRegKey& keyDst,
|
||||||
|
const wxChar *szNewName = NULL);
|
||||||
|
// copy the entire contents of the key recursively to another location
|
||||||
|
bool Copy(const wxString& strNewName);
|
||||||
|
// same as Copy() but using a key and not the name
|
||||||
|
bool Copy(wxRegKey& keyDst);
|
||||||
// close the key (will be automatically done in dtor)
|
// close the key (will be automatically done in dtor)
|
||||||
bool Close();
|
bool Close();
|
||||||
|
|
||||||
|
@@ -34,6 +34,7 @@ typedef long wxDataType;
|
|||||||
|
|
||||||
// fwd decl
|
// fwd decl
|
||||||
class WXDLLEXPORT wxImageList;
|
class WXDLLEXPORT wxImageList;
|
||||||
|
class WXDLLEXPORT wxDragImage;
|
||||||
struct WXDLLEXPORT wxTreeViewItem;
|
struct WXDLLEXPORT wxTreeViewItem;
|
||||||
|
|
||||||
// a callback function used for sorting tree items, it should return -1 if the
|
// a callback function used for sorting tree items, it should return -1 if the
|
||||||
@@ -439,6 +440,7 @@ public:
|
|||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
// --------------
|
// --------------
|
||||||
|
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||||
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
|
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
|
||||||
|
|
||||||
@@ -498,6 +500,9 @@ private:
|
|||||||
// TRUE if the hash above is not empty
|
// TRUE if the hash above is not empty
|
||||||
bool m_hasAnyAttr;
|
bool m_hasAnyAttr;
|
||||||
|
|
||||||
|
// used for dragging
|
||||||
|
wxDragImage *m_dragImage;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxTreeCtrl)
|
DECLARE_DYNAMIC_CLASS(wxTreeCtrl)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -149,7 +149,7 @@ public:
|
|||||||
const wxString& GetLabel() const { return m_label; }
|
const wxString& GetLabel() const { return m_label; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// TODO we could save some space by using union here
|
// we could probably save some space by using union here
|
||||||
int m_code;
|
int m_code;
|
||||||
wxTreeItemId m_item,
|
wxTreeItemId m_item,
|
||||||
m_itemOld;
|
m_itemOld;
|
||||||
@@ -166,9 +166,16 @@ typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&);
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// GetItem() returns the item being dragged, GetPoint() the mouse coords
|
// GetItem() returns the item being dragged, GetPoint() the mouse coords
|
||||||
|
//
|
||||||
|
// if you call event.Allow(), the drag operation will start and a
|
||||||
|
// EVT_TREE_END_DRAG event will be sent when the drag is over.
|
||||||
#define EVT_TREE_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
#define EVT_TREE_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||||
#define EVT_TREE_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
#define EVT_TREE_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
|
||||||
|
// GetItem() is the item on which the drop occured (if any) and GetPoint() the
|
||||||
|
// current mouse coords
|
||||||
|
#define EVT_TREE_END_DRAG(id, fn) { wxEVT_COMMAND_TREE_END_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL },
|
||||||
|
|
||||||
// GetItem() returns the itme whose label is being edited, GetLabel() returns
|
// GetItem() returns the itme whose label is being edited, GetLabel() returns
|
||||||
// the current item label for BEGIN and the would be new one for END.
|
// the current item label for BEGIN and the would be new one for END.
|
||||||
//
|
//
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: registry.cpp
|
// Name: regtest.cpp
|
||||||
// Purpose: wxRegKey class demo
|
// Purpose: wxRegKey class demo
|
||||||
// Author: Vadim Zeitlin
|
// Author: Vadim Zeitlin
|
||||||
// Modified by:
|
// Modified by:
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
class RegApp : public wxApp
|
class RegApp : public wxApp
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool OnInit(void);
|
bool OnInit();
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -58,9 +58,6 @@ public:
|
|||||||
RegImageList();
|
RegImageList();
|
||||||
};
|
};
|
||||||
|
|
||||||
// array of children of the node
|
|
||||||
//class TreeNode;
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// our control
|
// our control
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -76,14 +73,19 @@ public:
|
|||||||
void OnItemExpanding(wxTreeEvent& event);
|
void OnItemExpanding(wxTreeEvent& event);
|
||||||
void OnSelChanged (wxTreeEvent& event);
|
void OnSelChanged (wxTreeEvent& event);
|
||||||
|
|
||||||
|
void OnBeginDrag (wxTreeEvent& event);
|
||||||
|
void OnEndDrag (wxTreeEvent& event);
|
||||||
|
|
||||||
void OnRightClick (wxMouseEvent& event);
|
void OnRightClick (wxMouseEvent& event);
|
||||||
void OnChar (wxKeyEvent& event);
|
void OnChar (wxKeyEvent& event);
|
||||||
|
void OnIdle (wxIdleEvent& event);
|
||||||
|
|
||||||
// forwarded notifications (by the frame)
|
// forwarded notifications (by the frame)
|
||||||
void OnMenuTest();
|
void OnMenuTest();
|
||||||
|
|
||||||
// operations
|
// operations
|
||||||
void DeleteSelected();
|
void DeleteSelected();
|
||||||
|
void ShowProperties();
|
||||||
void CreateNewKey(const wxString& strName);
|
void CreateNewKey(const wxString& strName);
|
||||||
void CreateNewTextValue(const wxString& strName);
|
void CreateNewTextValue(const wxString& strName);
|
||||||
void CreateNewBinaryValue(const wxString& strName);
|
void CreateNewBinaryValue(const wxString& strName);
|
||||||
@@ -91,14 +93,11 @@ public:
|
|||||||
// information
|
// information
|
||||||
bool IsKeySelected() const;
|
bool IsKeySelected() const;
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// structure describing a registry key/value
|
// structure describing a registry key/value
|
||||||
class TreeNode : public wxTreeItemData
|
class TreeNode : public wxTreeItemData
|
||||||
{
|
{
|
||||||
WX_DEFINE_ARRAY(TreeNode *, TreeChildren);
|
WX_DEFINE_ARRAY(TreeNode *, TreeChildren);
|
||||||
public:
|
public:
|
||||||
RegTreeCtrl *m_pTree; // must be !NULL
|
RegTreeCtrl *m_pTree; // must be !NULL
|
||||||
TreeNode *m_pParent; // NULL only for the root node
|
TreeNode *m_pParent; // NULL only for the root node
|
||||||
@@ -107,10 +106,6 @@ WX_DEFINE_ARRAY(TreeNode *, TreeChildren);
|
|||||||
TreeChildren m_aChildren; // array of subkeys/values
|
TreeChildren m_aChildren; // array of subkeys/values
|
||||||
bool m_bKey; // key or value?
|
bool m_bKey; // key or value?
|
||||||
wxRegKey *m_pKey; // only may be !NULL if m_bKey == true
|
wxRegKey *m_pKey; // only may be !NULL if m_bKey == true
|
||||||
long m_lDummy; // dummy subkey (to make expansion possible)
|
|
||||||
|
|
||||||
// ctor
|
|
||||||
TreeNode() { m_lDummy = 0; }
|
|
||||||
|
|
||||||
// trivial accessors
|
// trivial accessors
|
||||||
long Id() const { return m_id; }
|
long Id() const { return m_id; }
|
||||||
@@ -123,8 +118,8 @@ WX_DEFINE_ARRAY(TreeNode *, TreeChildren);
|
|||||||
void OnCollapse();
|
void OnCollapse();
|
||||||
|
|
||||||
// operations
|
// operations
|
||||||
void Refresh() { OnCollapse(); OnExpand(); }
|
void Refresh();
|
||||||
void AddDummy();
|
bool DeleteChild(TreeNode *child);
|
||||||
void DestroyChildren();
|
void DestroyChildren();
|
||||||
const char *FullName() const;
|
const char *FullName() const;
|
||||||
|
|
||||||
@@ -135,9 +130,15 @@ WX_DEFINE_ARRAY(TreeNode *, TreeChildren);
|
|||||||
~TreeNode();
|
~TreeNode();
|
||||||
};
|
};
|
||||||
|
|
||||||
wxMenu *m_pMenuPopup;
|
|
||||||
TreeNode *m_pRoot;
|
|
||||||
wxImageList *m_imageList;
|
wxImageList *m_imageList;
|
||||||
|
wxMenu *m_pMenuPopup;
|
||||||
|
|
||||||
|
TreeNode *m_pRoot;
|
||||||
|
|
||||||
|
TreeNode *m_draggedItem; // the item being dragged
|
||||||
|
bool m_copyOnDrop; // if FALSE, then move
|
||||||
|
|
||||||
|
bool m_restoreStatus; // after OnItemExpanding()
|
||||||
|
|
||||||
TreeNode *GetNode(const wxTreeEvent& event)
|
TreeNode *GetNode(const wxTreeEvent& event)
|
||||||
{ return (TreeNode *)GetItemData((WXHTREEITEM)event.GetItem()); }
|
{ return (TreeNode *)GetItemData((WXHTREEITEM)event.GetItem()); }
|
||||||
@@ -150,6 +151,9 @@ public:
|
|||||||
const wxString *pstrValue = NULL);
|
const wxString *pstrValue = NULL);
|
||||||
// add standard registry keys
|
// add standard registry keys
|
||||||
void AddStdKeys();
|
void AddStdKeys();
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_EVENT_TABLE();
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -160,7 +164,7 @@ class RegFrame : public wxFrame
|
|||||||
public:
|
public:
|
||||||
// ctor & dtor
|
// ctor & dtor
|
||||||
RegFrame(wxFrame *parent, char *title, int x, int y, int w, int h);
|
RegFrame(wxFrame *parent, char *title, int x, int y, int w, int h);
|
||||||
virtual ~RegFrame(void);
|
virtual ~RegFrame();
|
||||||
|
|
||||||
// callbacks
|
// callbacks
|
||||||
void OnQuit (wxCommandEvent& event);
|
void OnQuit (wxCommandEvent& event);
|
||||||
@@ -176,7 +180,7 @@ public:
|
|||||||
void OnNewText (wxCommandEvent& event);
|
void OnNewText (wxCommandEvent& event);
|
||||||
void OnNewBinary(wxCommandEvent& event);
|
void OnNewBinary(wxCommandEvent& event);
|
||||||
|
|
||||||
bool OnClose () { return TRUE; }
|
void OnInfo (wxCommandEvent& event);
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE();
|
DECLARE_EVENT_TABLE();
|
||||||
|
|
||||||
@@ -201,6 +205,7 @@ enum
|
|||||||
Menu_NewText,
|
Menu_NewText,
|
||||||
Menu_NewBinary,
|
Menu_NewBinary,
|
||||||
Menu_Delete,
|
Menu_Delete,
|
||||||
|
Menu_Info,
|
||||||
|
|
||||||
Ctrl_RegTree = 200,
|
Ctrl_RegTree = 200,
|
||||||
};
|
};
|
||||||
@@ -220,15 +225,20 @@ BEGIN_EVENT_TABLE(RegFrame, wxFrame)
|
|||||||
EVT_MENU(Menu_NewKey, RegFrame::OnNewKey)
|
EVT_MENU(Menu_NewKey, RegFrame::OnNewKey)
|
||||||
EVT_MENU(Menu_NewText, RegFrame::OnNewText)
|
EVT_MENU(Menu_NewText, RegFrame::OnNewText)
|
||||||
EVT_MENU(Menu_NewBinary,RegFrame::OnNewBinary)
|
EVT_MENU(Menu_NewBinary,RegFrame::OnNewBinary)
|
||||||
|
EVT_MENU(Menu_Info, RegFrame::OnInfo)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(RegTreeCtrl, wxTreeCtrl)
|
BEGIN_EVENT_TABLE(RegTreeCtrl, wxTreeCtrl)
|
||||||
EVT_TREE_DELETE_ITEM (Ctrl_RegTree, RegTreeCtrl::OnDeleteItem)
|
EVT_TREE_DELETE_ITEM (Ctrl_RegTree, RegTreeCtrl::OnDeleteItem)
|
||||||
EVT_TREE_ITEM_EXPANDING(Ctrl_RegTree, RegTreeCtrl::OnItemExpanding)
|
EVT_TREE_ITEM_EXPANDING(Ctrl_RegTree, RegTreeCtrl::OnItemExpanding)
|
||||||
EVT_TREE_SEL_CHANGED (Ctrl_RegTree, RegTreeCtrl::OnSelChanged)
|
EVT_TREE_SEL_CHANGED (Ctrl_RegTree, RegTreeCtrl::OnSelChanged)
|
||||||
|
EVT_TREE_BEGIN_DRAG (Ctrl_RegTree, RegTreeCtrl::OnBeginDrag)
|
||||||
|
EVT_TREE_BEGIN_RDRAG (Ctrl_RegTree, RegTreeCtrl::OnBeginDrag)
|
||||||
|
EVT_TREE_END_DRAG (Ctrl_RegTree, RegTreeCtrl::OnEndDrag)
|
||||||
|
|
||||||
EVT_CHAR (RegTreeCtrl::OnChar)
|
EVT_CHAR (RegTreeCtrl::OnChar)
|
||||||
EVT_RIGHT_DOWN(RegTreeCtrl::OnRightClick)
|
EVT_RIGHT_DOWN(RegTreeCtrl::OnRightClick)
|
||||||
|
EVT_IDLE (RegTreeCtrl::OnIdle)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -255,6 +265,8 @@ wxMenu *CreateRegistryMenu()
|
|||||||
pMenuReg->Append(Menu_Expand, "&Expand", "Expand current key");
|
pMenuReg->Append(Menu_Expand, "&Expand", "Expand current key");
|
||||||
pMenuReg->Append(Menu_Collapse, "&Collapse", "Collapse current key");
|
pMenuReg->Append(Menu_Collapse, "&Collapse", "Collapse current key");
|
||||||
pMenuReg->Append(Menu_Toggle, "&Toggle", "Toggle current key");
|
pMenuReg->Append(Menu_Toggle, "&Toggle", "Toggle current key");
|
||||||
|
pMenuReg->AppendSeparator();
|
||||||
|
pMenuReg->Append(Menu_Info, "&Properties","Information about current selection");
|
||||||
|
|
||||||
return pMenuReg;
|
return pMenuReg;
|
||||||
}
|
}
|
||||||
@@ -268,7 +280,7 @@ IMPLEMENT_APP(RegApp)
|
|||||||
bool RegApp::OnInit()
|
bool RegApp::OnInit()
|
||||||
{
|
{
|
||||||
// create the main frame window and show it
|
// create the main frame window and show it
|
||||||
RegFrame *frame = new RegFrame(NULL, "wxRegKey Test", 50, 50, 600, 350);
|
RegFrame *frame = new RegFrame(NULL, "wxRegTest", 50, 50, 600, 350);
|
||||||
frame->Show(TRUE);
|
frame->Show(TRUE);
|
||||||
|
|
||||||
SetTopWindow(frame);
|
SetTopWindow(frame);
|
||||||
@@ -317,8 +329,10 @@ RegFrame::RegFrame(wxFrame *parent, char *title, int x, int y, int w, int h)
|
|||||||
SetStatusWidths(2, aWidths);
|
SetStatusWidths(2, aWidths);
|
||||||
}
|
}
|
||||||
|
|
||||||
RegFrame::~RegFrame(void)
|
RegFrame::~RegFrame()
|
||||||
{
|
{
|
||||||
|
// this makes deletion of it *much* quicker
|
||||||
|
m_treeCtrl->Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegFrame::OnQuit(wxCommandEvent& event)
|
void RegFrame::OnQuit(wxCommandEvent& event)
|
||||||
@@ -328,8 +342,10 @@ void RegFrame::OnQuit(wxCommandEvent& event)
|
|||||||
|
|
||||||
void RegFrame::OnAbout(wxCommandEvent& event)
|
void RegFrame::OnAbout(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
wxMessageDialog dialog(this, "wxRegistry sample\n(c) 1998 Vadim Zeitlin",
|
wxMessageDialog dialog(this,
|
||||||
"About wxRegistry", wxOK);
|
"wxRegistry sample\n"
|
||||||
|
"<EFBFBD> 1998, 2000 Vadim Zeitlin",
|
||||||
|
"About wxRegTest", wxOK);
|
||||||
|
|
||||||
dialog.ShowModal();
|
dialog.ShowModal();
|
||||||
}
|
}
|
||||||
@@ -383,6 +399,11 @@ void RegFrame::OnNewBinary(wxCommandEvent& event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RegFrame::OnInfo(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
m_treeCtrl->ShowProperties();
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// RegImageList
|
// RegImageList
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -413,7 +434,7 @@ RegTreeCtrl::TreeNode *RegTreeCtrl::InsertNewTreeNode(TreeNode *pParent,
|
|||||||
pNewNode->m_strName = strName;
|
pNewNode->m_strName = strName;
|
||||||
pNewNode->m_bKey = pstrValue == NULL;
|
pNewNode->m_bKey = pstrValue == NULL;
|
||||||
pNewNode->m_pKey = NULL;
|
pNewNode->m_pKey = NULL;
|
||||||
pNewNode->m_id = InsertItem(pParent ? pParent->m_id : 0,
|
pNewNode->m_id = InsertItem(pParent ? pParent->Id() : 0,
|
||||||
pNewNode->IsKey() ? strName : *pstrValue,
|
pNewNode->IsKey() ? strName : *pstrValue,
|
||||||
idImage);
|
idImage);
|
||||||
|
|
||||||
@@ -427,9 +448,16 @@ RegTreeCtrl::TreeNode *RegTreeCtrl::InsertNewTreeNode(TreeNode *pParent,
|
|||||||
pParent->m_aChildren.Add(pNewNode);
|
pParent->m_aChildren.Add(pNewNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// force the [+] button (@@@ not very elegant...)
|
if ( pNewNode->IsKey() ) {
|
||||||
if ( pNewNode->IsKey() )
|
SetItemHasChildren(pNewNode->Id());
|
||||||
pNewNode->AddDummy();
|
|
||||||
|
if ( !pNewNode->IsRoot() ) {
|
||||||
|
// set the expanded icon as well
|
||||||
|
SetItemImage(pNewNode->Id(),
|
||||||
|
RegImageList::OpenedKey,
|
||||||
|
wxTreeItemIcon_Expanded);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return pNewNode;
|
return pNewNode;
|
||||||
}
|
}
|
||||||
@@ -438,6 +466,10 @@ RegTreeCtrl::RegTreeCtrl(wxWindow *parent, wxWindowID id)
|
|||||||
: wxTreeCtrl(parent, id, wxDefaultPosition, wxDefaultSize,
|
: wxTreeCtrl(parent, id, wxDefaultPosition, wxDefaultSize,
|
||||||
wxTR_HAS_BUTTONS | wxSUNKEN_BORDER)
|
wxTR_HAS_BUTTONS | wxSUNKEN_BORDER)
|
||||||
{
|
{
|
||||||
|
// init members
|
||||||
|
m_draggedItem = NULL;
|
||||||
|
m_restoreStatus = FALSE;
|
||||||
|
|
||||||
// create the image list
|
// create the image list
|
||||||
// ---------------------
|
// ---------------------
|
||||||
m_imageList = new RegImageList;
|
m_imageList = new RegImageList;
|
||||||
@@ -455,7 +487,7 @@ RegTreeCtrl::RegTreeCtrl(wxWindow *parent, wxWindowID id)
|
|||||||
RegTreeCtrl::~RegTreeCtrl()
|
RegTreeCtrl::~RegTreeCtrl()
|
||||||
{
|
{
|
||||||
delete m_pMenuPopup;
|
delete m_pMenuPopup;
|
||||||
delete m_pRoot;
|
// delete m_pRoot; -- this is done by the tree now
|
||||||
delete m_imageList;
|
delete m_imageList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -470,16 +502,30 @@ void RegTreeCtrl::AddStdKeys()
|
|||||||
// notifications
|
// notifications
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void RegTreeCtrl::OnIdle(wxIdleEvent& WXUNUSED(event))
|
||||||
|
{
|
||||||
|
if ( m_restoreStatus ) {
|
||||||
|
// restore it after OnItemExpanding()
|
||||||
|
wxLogStatus("Ok");
|
||||||
|
wxSetCursor(*wxSTANDARD_CURSOR);
|
||||||
|
|
||||||
|
m_restoreStatus = FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void RegTreeCtrl::OnRightClick(wxMouseEvent& event)
|
void RegTreeCtrl::OnRightClick(wxMouseEvent& event)
|
||||||
{
|
{
|
||||||
int iFlags;
|
int iFlags;
|
||||||
long lId = HitTest(wxPoint(event.GetX(), event.GetY()), iFlags);
|
long lId = HitTest(wxPoint(event.GetX(), event.GetY()), iFlags);
|
||||||
if ( iFlags & wxTREE_HITTEST_ONITEMLABEL ) {
|
if ( !(iFlags & wxTREE_HITTEST_ONITEMLABEL) ) {
|
||||||
// popup menu only if an item was clicked
|
// take the currently selected item if click not on item
|
||||||
wxASSERT( lId != 0 );
|
lId = GetSelection();
|
||||||
SelectItem(lId);
|
|
||||||
PopupMenu(m_pMenuPopup, event.GetX(), event.GetY());
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
SelectItem(lId);
|
||||||
|
}
|
||||||
|
|
||||||
|
PopupMenu(m_pMenuPopup, event.GetX(), event.GetY());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -526,9 +572,21 @@ void RegTreeCtrl::OnMenuTest()
|
|||||||
|
|
||||||
void RegTreeCtrl::OnChar(wxKeyEvent& event)
|
void RegTreeCtrl::OnChar(wxKeyEvent& event)
|
||||||
{
|
{
|
||||||
if ( event.KeyCode() == WXK_DELETE )
|
switch ( event.KeyCode() )
|
||||||
|
{
|
||||||
|
case WXK_DELETE:
|
||||||
DeleteSelected();
|
DeleteSelected();
|
||||||
else
|
return;
|
||||||
|
|
||||||
|
case WXK_RETURN:
|
||||||
|
if ( event.AltDown() )
|
||||||
|
{
|
||||||
|
ShowProperties();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -547,6 +605,7 @@ void RegTreeCtrl::OnItemExpanding(wxTreeEvent& event)
|
|||||||
wxSetCursor(*wxHOURGLASS_CURSOR);
|
wxSetCursor(*wxHOURGLASS_CURSOR);
|
||||||
wxLogStatus("Working...");
|
wxLogStatus("Working...");
|
||||||
wxYield(); // to give the status line a chance to refresh itself
|
wxYield(); // to give the status line a chance to refresh itself
|
||||||
|
m_restoreStatus = TRUE; // some time later...
|
||||||
|
|
||||||
if ( pNode->IsKey() ) {
|
if ( pNode->IsKey() ) {
|
||||||
if ( bExpanding ) {
|
if ( bExpanding ) {
|
||||||
@@ -558,17 +617,116 @@ void RegTreeCtrl::OnItemExpanding(wxTreeEvent& event)
|
|||||||
// collapsing: clean up
|
// collapsing: clean up
|
||||||
pNode->OnCollapse();
|
pNode->OnCollapse();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// change icon for non root key
|
void RegTreeCtrl::OnBeginDrag(wxTreeEvent& event)
|
||||||
if ( !pNode->IsRoot() ) {
|
{
|
||||||
int idIcon = bExpanding ? RegImageList::OpenedKey
|
m_copyOnDrop = event.GetEventType() == wxEVT_COMMAND_TREE_BEGIN_DRAG;
|
||||||
: RegImageList::ClosedKey;
|
|
||||||
SetItemImage(pNode->Id(), idIcon);
|
TreeNode *pNode = GetNode(event);
|
||||||
|
if ( pNode->IsRoot() || pNode->Parent()->IsRoot() )
|
||||||
|
{
|
||||||
|
wxLogStatus("This registry key can't be %s.",
|
||||||
|
m_copyOnDrop ? "copied" : "moved");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wxLogStatus("%s item %s...",
|
||||||
|
m_copyOnDrop ? "Copying" : "Moving",
|
||||||
|
pNode->FullName());
|
||||||
|
|
||||||
|
m_draggedItem = pNode;
|
||||||
|
|
||||||
|
event.Allow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RegTreeCtrl::OnEndDrag(wxTreeEvent& event)
|
||||||
|
{
|
||||||
|
wxCHECK_RET( m_draggedItem, "end drag without begin drag?" );
|
||||||
|
|
||||||
|
// clear the pointer anyhow
|
||||||
|
TreeNode *src = m_draggedItem;
|
||||||
|
m_draggedItem = NULL;
|
||||||
|
|
||||||
|
// where are we going to drop it?
|
||||||
|
TreeNode *dst = GetNode(event);
|
||||||
|
if ( dst && !dst->IsKey() ) {
|
||||||
|
// we need a parent key
|
||||||
|
dst = dst->Parent();
|
||||||
|
}
|
||||||
|
if ( !dst || dst->IsRoot() ) {
|
||||||
|
wxLogError("Can't create a key here.");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isKey = src->IsKey();
|
||||||
|
if ( (isKey && (src == dst)) ||
|
||||||
|
(!isKey && (src->Parent() == dst)) ) {
|
||||||
|
wxLogStatus("Can't copy something on itself");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove the "Registry Root\\" from the full name
|
||||||
|
wxString nameSrc, nameDst;
|
||||||
|
nameSrc << wxString(src->FullName()).AfterFirst('\\');
|
||||||
|
nameDst << wxString(dst->FullName()).AfterFirst('\\') << '\\'
|
||||||
|
<< wxString(src->FullName()).AfterLast('\\');
|
||||||
|
|
||||||
|
wxString verb = m_copyOnDrop ? "copy" : "move";
|
||||||
|
wxString what = isKey ? "key" : "value";
|
||||||
|
|
||||||
|
if ( wxMessageBox(wxString::Format
|
||||||
|
(
|
||||||
|
"Do you really want to %s the %s %s to %s?",
|
||||||
|
verb.c_str(),
|
||||||
|
what.c_str(),
|
||||||
|
nameSrc.c_str(),
|
||||||
|
nameDst.c_str()
|
||||||
|
),
|
||||||
|
"RegTest Confirm",
|
||||||
|
wxICON_QUESTION | wxYES_NO | wxCANCEL, this) != wxYES ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool dstExpanded = IsExpanded(dst->Id());
|
||||||
|
|
||||||
|
bool ok;
|
||||||
|
if ( isKey ) {
|
||||||
|
wxRegKey& key = src->Key();
|
||||||
|
ok = key.Copy(dst->Key());
|
||||||
|
if ( ok && dstExpanded ) {
|
||||||
|
dst->OnCollapse();
|
||||||
|
dst->OnExpand();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ok && !m_copyOnDrop ) {
|
||||||
|
// delete the old key
|
||||||
|
ok = key.DeleteSelf();
|
||||||
|
if ( ok ) {
|
||||||
|
src->Parent()->Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else { // value
|
||||||
|
wxRegKey& key = src->Parent()->Key();
|
||||||
|
ok = key.CopyValue(src->m_strName, dst->Key());
|
||||||
|
if ( ok && !m_copyOnDrop ) {
|
||||||
|
// we move it, so delete the old one
|
||||||
|
ok = key.DeleteValue(src->m_strName);
|
||||||
|
if ( ok ) {
|
||||||
|
// reexpand the key
|
||||||
|
dst->Refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxLogStatus("Ok");
|
if ( !ok ) {
|
||||||
wxSetCursor(*wxSTANDARD_CURSOR);
|
wxLogError("Failed to %s registry %s.", verb.c_str(), what.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -576,12 +734,8 @@ void RegTreeCtrl::OnItemExpanding(wxTreeEvent& event)
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
bool RegTreeCtrl::TreeNode::OnExpand()
|
bool RegTreeCtrl::TreeNode::OnExpand()
|
||||||
{
|
{
|
||||||
// remove dummy item
|
// we add children only once
|
||||||
if ( m_lDummy != 0 ) {
|
if ( !m_aChildren.IsEmpty() ) {
|
||||||
m_pTree->Delete(m_lDummy);
|
|
||||||
m_lDummy = 0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// we've been already expanded
|
// we've been already expanded
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -606,6 +760,9 @@ bool RegTreeCtrl::TreeNode::OnExpand()
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if we're empty, we shouldn't be expandable at all
|
||||||
|
bool isEmpty = TRUE;
|
||||||
|
|
||||||
// enumeration variables
|
// enumeration variables
|
||||||
long l;
|
long l;
|
||||||
wxString str;
|
wxString str;
|
||||||
@@ -616,6 +773,9 @@ bool RegTreeCtrl::TreeNode::OnExpand()
|
|||||||
while ( bCont ) {
|
while ( bCont ) {
|
||||||
m_pTree->InsertNewTreeNode(this, str, RegImageList::ClosedKey);
|
m_pTree->InsertNewTreeNode(this, str, RegImageList::ClosedKey);
|
||||||
bCont = m_pKey->GetNextKey(str, l);
|
bCont = m_pKey->GetNextKey(str, l);
|
||||||
|
|
||||||
|
// we have at least this key...
|
||||||
|
isEmpty = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// enumerate all values
|
// enumerate all values
|
||||||
@@ -649,11 +809,9 @@ bool RegTreeCtrl::TreeNode::OnExpand()
|
|||||||
|
|
||||||
case wxRegKey::Type_Dword:
|
case wxRegKey::Type_Dword:
|
||||||
{
|
{
|
||||||
char szBuf[128];
|
|
||||||
long l;
|
long l;
|
||||||
m_pKey->QueryValue(str, &l);
|
m_pKey->QueryValue(str, &l);
|
||||||
sprintf(szBuf, "%lx", l);
|
strItem << l;
|
||||||
strItem += szBuf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// fall through
|
// fall through
|
||||||
@@ -664,6 +822,17 @@ bool RegTreeCtrl::TreeNode::OnExpand()
|
|||||||
|
|
||||||
m_pTree->InsertNewTreeNode(this, str, icon, &strItem);
|
m_pTree->InsertNewTreeNode(this, str, icon, &strItem);
|
||||||
bCont = m_pKey->GetNextValue(str, l);
|
bCont = m_pKey->GetNextValue(str, l);
|
||||||
|
|
||||||
|
// we have at least this value...
|
||||||
|
isEmpty = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isEmpty ) {
|
||||||
|
// this is for the case when our last child was just deleted
|
||||||
|
m_pTree->Collapse(Id());
|
||||||
|
|
||||||
|
// we won't be expanded any more
|
||||||
|
m_pTree->SetItemHasChildren(Id(), FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -671,30 +840,58 @@ bool RegTreeCtrl::TreeNode::OnExpand()
|
|||||||
|
|
||||||
void RegTreeCtrl::TreeNode::OnCollapse()
|
void RegTreeCtrl::TreeNode::OnCollapse()
|
||||||
{
|
{
|
||||||
bool bHasChildren = !m_aChildren.IsEmpty();
|
|
||||||
DestroyChildren();
|
DestroyChildren();
|
||||||
if ( bHasChildren )
|
|
||||||
AddDummy();
|
|
||||||
else
|
|
||||||
m_lDummy = 0;
|
|
||||||
|
|
||||||
delete m_pKey;
|
delete m_pKey;
|
||||||
m_pKey = NULL;
|
m_pKey = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegTreeCtrl::TreeNode::AddDummy()
|
void RegTreeCtrl::TreeNode::Refresh()
|
||||||
{
|
{
|
||||||
// insert dummy item forcing appearance of [+] button
|
if ( m_pTree->IsExpanded(Id()) )
|
||||||
m_lDummy = m_pTree->InsertItem(Id(), "");
|
{
|
||||||
|
m_pTree->Collapse(Id());
|
||||||
|
m_pTree->SetItemHasChildren(Id());
|
||||||
|
m_pTree->Expand(Id());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool RegTreeCtrl::TreeNode::DeleteChild(TreeNode *child)
|
||||||
|
{
|
||||||
|
int index = m_aChildren.Index(child);
|
||||||
|
wxCHECK_MSG( index != wxNOT_FOUND, FALSE,
|
||||||
|
"our child in tree should be in m_aChildren" );
|
||||||
|
|
||||||
|
m_aChildren.RemoveAt((size_t)index);
|
||||||
|
|
||||||
|
bool ok;
|
||||||
|
if ( child->IsKey() ) {
|
||||||
|
// must close key before deleting it
|
||||||
|
child->OnCollapse();
|
||||||
|
|
||||||
|
ok = Key().DeleteKey(child->m_strName);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ok = Key().DeleteValue(child->m_strName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ok ) {
|
||||||
|
m_pTree->Delete(child->Id());
|
||||||
|
|
||||||
|
Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegTreeCtrl::TreeNode::DestroyChildren()
|
void RegTreeCtrl::TreeNode::DestroyChildren()
|
||||||
{
|
{
|
||||||
// destroy all children
|
// destroy all children
|
||||||
unsigned int nCount = m_aChildren.Count();
|
size_t nCount = m_aChildren.GetCount();
|
||||||
for ( unsigned int n = 0; n < nCount; n++ ) {
|
for ( size_t n = 0; n < nCount; n++ ) {
|
||||||
long lId = m_aChildren[n]->Id();
|
long lId = m_aChildren[n]->Id();
|
||||||
delete m_aChildren[n];
|
// no, wxTreeCtrl will do it
|
||||||
|
//delete m_aChildren[n];
|
||||||
m_pTree->Delete(lId);
|
m_pTree->Delete(lId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -703,8 +900,6 @@ void RegTreeCtrl::TreeNode::DestroyChildren()
|
|||||||
|
|
||||||
RegTreeCtrl::TreeNode::~TreeNode()
|
RegTreeCtrl::TreeNode::~TreeNode()
|
||||||
{
|
{
|
||||||
DestroyChildren();
|
|
||||||
|
|
||||||
delete m_pKey;
|
delete m_pKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -749,29 +944,18 @@ void RegTreeCtrl::DeleteSelected()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( pCurrent->IsKey() ) {
|
wxString what = pCurrent->IsKey() ? "key" : "value";
|
||||||
if ( wxMessageBox("Do you really want to delete this key?",
|
if ( wxMessageBox(wxString::Format
|
||||||
|
(
|
||||||
|
"Do you really want to delete this %s?",
|
||||||
|
what.c_str()
|
||||||
|
),
|
||||||
"Confirmation",
|
"Confirmation",
|
||||||
wxICON_QUESTION | wxYES_NO | wxCANCEL, this) != wxYES ) {
|
wxICON_QUESTION | wxYES_NO | wxCANCEL, this) != wxYES ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// must close key before deleting it
|
pParent->DeleteChild(pCurrent);
|
||||||
pCurrent->OnCollapse();
|
|
||||||
|
|
||||||
if ( pParent->Key().DeleteKey(pCurrent->m_strName) )
|
|
||||||
pParent->Refresh();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if ( wxMessageBox("Do you really want to delete this value?",
|
|
||||||
"Confirmation",
|
|
||||||
wxICON_QUESTION | wxYES_NO | wxCANCEL, this) != wxYES ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( pParent->Key().DeleteValue(pCurrent->m_strName) )
|
|
||||||
pParent->Refresh();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegTreeCtrl::CreateNewKey(const wxString& strName)
|
void RegTreeCtrl::CreateNewKey(const wxString& strName)
|
||||||
@@ -829,6 +1013,49 @@ void RegTreeCtrl::CreateNewBinaryValue(const wxString& strName)
|
|||||||
pCurrent->Refresh();
|
pCurrent->Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RegTreeCtrl::ShowProperties()
|
||||||
|
{
|
||||||
|
long lCurrent = GetSelection();
|
||||||
|
TreeNode *pCurrent = (TreeNode *)GetItemData(lCurrent);
|
||||||
|
|
||||||
|
if ( !pCurrent || pCurrent->IsRoot() )
|
||||||
|
{
|
||||||
|
wxLogStatus("No properties");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( pCurrent->IsKey() )
|
||||||
|
{
|
||||||
|
const wxRegKey& key = pCurrent->Key();
|
||||||
|
size_t nSubKeys, nValues;
|
||||||
|
if ( !key.GetKeyInfo(&nSubKeys, NULL, &nValues, NULL) )
|
||||||
|
{
|
||||||
|
wxLogError("Couldn't get key info");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wxLogMessage("Key '%s' has %u subkeys and %u values.",
|
||||||
|
key.GetName().c_str(), nSubKeys, nValues);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // it's a value
|
||||||
|
{
|
||||||
|
TreeNode *parent = pCurrent->Parent();
|
||||||
|
wxCHECK_RET( parent, "reg value without key?" );
|
||||||
|
|
||||||
|
const wxRegKey& key = parent->Key();
|
||||||
|
const char *value = pCurrent->m_strName.c_str();
|
||||||
|
wxLogMessage("Value '%s' under the key '%s' is of type "
|
||||||
|
"%d (%s).",
|
||||||
|
value,
|
||||||
|
parent->m_strName.c_str(),
|
||||||
|
key.GetValueType(value),
|
||||||
|
key.IsNumericValue(value) ? "numeric" : "string");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool RegTreeCtrl::IsKeySelected() const
|
bool RegTreeCtrl::IsKeySelected() const
|
||||||
{
|
{
|
||||||
long lCurrent = GetSelection();
|
long lCurrent = GetSelection();
|
||||||
|
@@ -454,7 +454,7 @@ bool wxDB::setConnectionOptions(void)
|
|||||||
// Display the connection options to verify them
|
// Display the connection options to verify them
|
||||||
#ifdef DBDEBUG_CONSOLE
|
#ifdef DBDEBUG_CONSOLE
|
||||||
long l;
|
long l;
|
||||||
cout << ">>>>> CONNECTION OPTIONS <<<<<<" << endl;
|
cout << "****** CONNECTION OPTIONS ******" << endl;
|
||||||
|
|
||||||
if (SQLGetConnectOption(hdbc, SQL_AUTOCOMMIT, &l) != SQL_SUCCESS)
|
if (SQLGetConnectOption(hdbc, SQL_AUTOCOMMIT, &l) != SQL_SUCCESS)
|
||||||
return(DispAllErrors(henv, hdbc));
|
return(DispAllErrors(henv, hdbc));
|
||||||
@@ -593,7 +593,7 @@ bool wxDB::getDbInfo(void)
|
|||||||
return(DispAllErrors(henv, hdbc));
|
return(DispAllErrors(henv, hdbc));
|
||||||
|
|
||||||
#ifdef DBDEBUG_CONSOLE
|
#ifdef DBDEBUG_CONSOLE
|
||||||
cout << ">>>>> DATA SOURCE INFORMATION <<<<<" << endl;
|
cout << "***** DATA SOURCE INFORMATION *****" << endl;
|
||||||
cout << "SERVER Name: " << dbInf.serverName << endl;
|
cout << "SERVER Name: " << dbInf.serverName << endl;
|
||||||
cout << "DBMS Name: " << dbInf.dbmsName << "; DBMS Version: " << dbInf.dbmsVer << endl;
|
cout << "DBMS Name: " << dbInf.dbmsName << "; DBMS Version: " << dbInf.dbmsVer << endl;
|
||||||
cout << "ODBC Version: " << dbInf.odbcVer << "; Driver Version: " << dbInf.driverVer << endl;
|
cout << "ODBC Version: " << dbInf.odbcVer << "; Driver Version: " << dbInf.driverVer << endl;
|
||||||
|
@@ -46,231 +46,15 @@
|
|||||||
#include "wx/validate.h"
|
#include "wx/validate.h"
|
||||||
#endif // wxUSE_GUI
|
#endif // wxUSE_GUI
|
||||||
|
|
||||||
|
|
||||||
#if defined(__VISAGECPP__) && __IBMCPP__ >= 400
|
|
||||||
// must define these static for VA or else you get multiply defined symbols everywhere
|
|
||||||
const wxEventType wxEVT_NULL = 0;
|
|
||||||
const wxEventType wxEVT_FIRST = 10000;
|
|
||||||
|
|
||||||
const wxEventType wxEVT_COMMAND_BUTTON_CLICKED = wxEVT_FIRST + 1;
|
|
||||||
const wxEventType wxEVT_COMMAND_CHECKBOX_CLICKED = wxEVT_FIRST + 2;
|
|
||||||
const wxEventType wxEVT_COMMAND_CHOICE_SELECTED = wxEVT_FIRST + 3;
|
|
||||||
const wxEventType wxEVT_COMMAND_LISTBOX_SELECTED = wxEVT_FIRST + 4;
|
|
||||||
const wxEventType wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = wxEVT_FIRST + 5;
|
|
||||||
const wxEventType wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = wxEVT_FIRST + 6;
|
|
||||||
const wxEventType wxEVT_COMMAND_TEXT_UPDATED = wxEVT_FIRST + 7;
|
|
||||||
const wxEventType wxEVT_COMMAND_TEXT_ENTER = wxEVT_FIRST + 8;
|
|
||||||
const wxEventType wxEVT_COMMAND_MENU_SELECTED = wxEVT_FIRST + 9;
|
|
||||||
const wxEventType wxEVT_COMMAND_TOOL_CLICKED = wxEVT_COMMAND_MENU_SELECTED;
|
|
||||||
const wxEventType wxEVT_COMMAND_SLIDER_UPDATED = wxEVT_FIRST + 10;
|
|
||||||
const wxEventType wxEVT_COMMAND_RADIOBOX_SELECTED = wxEVT_FIRST + 11;
|
|
||||||
const wxEventType wxEVT_COMMAND_RADIOBUTTON_SELECTED = wxEVT_FIRST + 12;
|
|
||||||
//const wxEventType wxEVT_COMMAND_SCROLLBAR_UPDATED is now obsolete since we use wxEVT_SCROLL... events
|
|
||||||
const wxEventType wxEVT_COMMAND_SCROLLBAR_UPDATED = wxEVT_FIRST + 13;
|
|
||||||
const wxEventType wxEVT_COMMAND_VLBOX_SELECTED = wxEVT_FIRST + 14;
|
|
||||||
const wxEventType wxEVT_COMMAND_COMBOBOX_SELECTED = wxEVT_FIRST + 15;
|
|
||||||
const wxEventType wxEVT_COMMAND_TOOL_RCLICKED = wxEVT_FIRST + 16;
|
|
||||||
const wxEventType wxEVT_COMMAND_TOOL_ENTER = wxEVT_FIRST + 17;
|
|
||||||
const wxEventType wxEVT_COMMAND_SPINCTRL_UPDATED = wxEVT_FIRST + 18;
|
|
||||||
|
|
||||||
/* Sockets send events, too */
|
|
||||||
const wxEventType wxEVT_SOCKET = wxEVT_FIRST + 50;
|
|
||||||
const wxEventType wxEVT_TIMER = wxEVT_FIRST + 80;
|
|
||||||
|
|
||||||
/* Mouse event types */
|
|
||||||
const wxEventType wxEVT_LEFT_DOWN = wxEVT_FIRST + 100;
|
|
||||||
const wxEventType wxEVT_LEFT_UP = wxEVT_FIRST + 101;
|
|
||||||
const wxEventType wxEVT_MIDDLE_DOWN = wxEVT_FIRST + 102;
|
|
||||||
const wxEventType wxEVT_MIDDLE_UP = wxEVT_FIRST + 103;
|
|
||||||
const wxEventType wxEVT_RIGHT_DOWN = wxEVT_FIRST + 104;
|
|
||||||
const wxEventType wxEVT_RIGHT_UP = wxEVT_FIRST + 105;
|
|
||||||
const wxEventType wxEVT_MOTION = wxEVT_FIRST + 106;
|
|
||||||
const wxEventType wxEVT_ENTER_WINDOW = wxEVT_FIRST + 107;
|
|
||||||
const wxEventType wxEVT_LEAVE_WINDOW = wxEVT_FIRST + 108;
|
|
||||||
const wxEventType wxEVT_LEFT_DCLICK = wxEVT_FIRST + 109;
|
|
||||||
const wxEventType wxEVT_MIDDLE_DCLICK = wxEVT_FIRST + 110;
|
|
||||||
const wxEventType wxEVT_RIGHT_DCLICK = wxEVT_FIRST + 111;
|
|
||||||
const wxEventType wxEVT_SET_FOCUS = wxEVT_FIRST + 112;
|
|
||||||
const wxEventType wxEVT_KILL_FOCUS = wxEVT_FIRST + 113;
|
|
||||||
|
|
||||||
/* Non-client mouse events */
|
|
||||||
const wxEventType wxEVT_NC_LEFT_DOWN = wxEVT_FIRST + 200;
|
|
||||||
const wxEventType wxEVT_NC_LEFT_UP = wxEVT_FIRST + 201;
|
|
||||||
const wxEventType wxEVT_NC_MIDDLE_DOWN = wxEVT_FIRST + 202;
|
|
||||||
const wxEventType wxEVT_NC_MIDDLE_UP = wxEVT_FIRST + 203;
|
|
||||||
const wxEventType wxEVT_NC_RIGHT_DOWN = wxEVT_FIRST + 204;
|
|
||||||
const wxEventType wxEVT_NC_RIGHT_UP = wxEVT_FIRST + 205;
|
|
||||||
const wxEventType wxEVT_NC_MOTION = wxEVT_FIRST + 206;
|
|
||||||
const wxEventType wxEVT_NC_ENTER_WINDOW = wxEVT_FIRST + 207;
|
|
||||||
const wxEventType wxEVT_NC_LEAVE_WINDOW = wxEVT_FIRST + 208;
|
|
||||||
const wxEventType wxEVT_NC_LEFT_DCLICK = wxEVT_FIRST + 209;
|
|
||||||
const wxEventType wxEVT_NC_MIDDLE_DCLICK = wxEVT_FIRST + 210;
|
|
||||||
const wxEventType wxEVT_NC_RIGHT_DCLICK = wxEVT_FIRST + 211;
|
|
||||||
|
|
||||||
/* Character input event type */
|
|
||||||
const wxEventType wxEVT_CHAR = wxEVT_FIRST + 212;
|
|
||||||
const wxEventType wxEVT_CHAR_HOOK = wxEVT_FIRST + 213;
|
|
||||||
const wxEventType wxEVT_NAVIGATION_KEY = wxEVT_FIRST + 214;
|
|
||||||
const wxEventType wxEVT_KEY_DOWN = wxEVT_FIRST + 215;
|
|
||||||
const wxEventType wxEVT_KEY_UP = wxEVT_FIRST + 216;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* wxScrollbar and wxSlider event identifiers
|
|
||||||
*/
|
|
||||||
const wxEventType wxEVT_SCROLL_TOP = wxEVT_FIRST + 300;
|
|
||||||
const wxEventType wxEVT_SCROLL_BOTTOM = wxEVT_FIRST + 301;
|
|
||||||
const wxEventType wxEVT_SCROLL_LINEUP = wxEVT_FIRST + 302;
|
|
||||||
const wxEventType wxEVT_SCROLL_LINEDOWN = wxEVT_FIRST + 303;
|
|
||||||
const wxEventType wxEVT_SCROLL_PAGEUP = wxEVT_FIRST + 304;
|
|
||||||
const wxEventType wxEVT_SCROLL_PAGEDOWN = wxEVT_FIRST + 305;
|
|
||||||
const wxEventType wxEVT_SCROLL_THUMBTRACK = wxEVT_FIRST + 306;
|
|
||||||
const wxEventType wxEVT_SCROLL_THUMBRELEASE = wxEVT_FIRST + 307;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Scroll events from wxWindow
|
|
||||||
*/
|
|
||||||
const wxEventType wxEVT_SCROLLWIN_TOP = wxEVT_FIRST + 320;
|
|
||||||
const wxEventType wxEVT_SCROLLWIN_BOTTOM = wxEVT_FIRST + 321;
|
|
||||||
const wxEventType wxEVT_SCROLLWIN_LINEUP = wxEVT_FIRST + 322;
|
|
||||||
const wxEventType wxEVT_SCROLLWIN_LINEDOWN = wxEVT_FIRST + 323;
|
|
||||||
const wxEventType wxEVT_SCROLLWIN_PAGEUP = wxEVT_FIRST + 324;
|
|
||||||
const wxEventType wxEVT_SCROLLWIN_PAGEDOWN = wxEVT_FIRST + 325;
|
|
||||||
const wxEventType wxEVT_SCROLLWIN_THUMBTRACK = wxEVT_FIRST + 326;
|
|
||||||
const wxEventType wxEVT_SCROLLWIN_THUMBRELEASE = wxEVT_FIRST + 327;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* System events
|
|
||||||
*/
|
|
||||||
const wxEventType wxEVT_SIZE = wxEVT_FIRST + 400;
|
|
||||||
const wxEventType wxEVT_MOVE = wxEVT_FIRST + 401;
|
|
||||||
const wxEventType wxEVT_CLOSE_WINDOW = wxEVT_FIRST + 402;
|
|
||||||
const wxEventType wxEVT_END_SESSION = wxEVT_FIRST + 403;
|
|
||||||
const wxEventType wxEVT_QUERY_END_SESSION = wxEVT_FIRST + 404;
|
|
||||||
const wxEventType wxEVT_ACTIVATE_APP = wxEVT_FIRST + 405;
|
|
||||||
const wxEventType wxEVT_POWER = wxEVT_FIRST + 406;
|
|
||||||
const wxEventType wxEVT_ACTIVATE = wxEVT_FIRST + 409;
|
|
||||||
const wxEventType wxEVT_CREATE = wxEVT_FIRST + 410;
|
|
||||||
const wxEventType wxEVT_DESTROY = wxEVT_FIRST + 411;
|
|
||||||
const wxEventType wxEVT_SHOW = wxEVT_FIRST + 412;
|
|
||||||
const wxEventType wxEVT_ICONIZE = wxEVT_FIRST + 413;
|
|
||||||
const wxEventType wxEVT_MAXIMIZE = wxEVT_FIRST + 414;
|
|
||||||
const wxEventType wxEVT_MOUSE_CAPTURE_CHANGED = wxEVT_FIRST + 415;
|
|
||||||
const wxEventType wxEVT_PAINT = wxEVT_FIRST + 416;
|
|
||||||
const wxEventType wxEVT_ERASE_BACKGROUND = wxEVT_FIRST + 417;
|
|
||||||
const wxEventType wxEVT_NC_PAINT = wxEVT_FIRST + 418;
|
|
||||||
const wxEventType wxEVT_PAINT_ICON = wxEVT_FIRST + 419;
|
|
||||||
const wxEventType wxEVT_MENU_CHAR = wxEVT_FIRST + 420;
|
|
||||||
const wxEventType wxEVT_MENU_INIT = wxEVT_FIRST + 421;
|
|
||||||
const wxEventType wxEVT_MENU_HIGHLIGHT = wxEVT_FIRST + 422;
|
|
||||||
const wxEventType wxEVT_POPUP_MENU_INIT = wxEVT_FIRST + 423;
|
|
||||||
const wxEventType wxEVT_CONTEXT_MENU = wxEVT_FIRST + 424;
|
|
||||||
const wxEventType wxEVT_SYS_COLOUR_CHANGED = wxEVT_FIRST + 425;
|
|
||||||
const wxEventType wxEVT_SETTING_CHANGED = wxEVT_FIRST + 426;
|
|
||||||
const wxEventType wxEVT_QUERY_NEW_PALETTE = wxEVT_FIRST + 427;
|
|
||||||
const wxEventType wxEVT_PALETTE_CHANGED = wxEVT_FIRST + 428;
|
|
||||||
const wxEventType wxEVT_JOY_BUTTON_DOWN = wxEVT_FIRST + 429;
|
|
||||||
const wxEventType wxEVT_JOY_BUTTON_UP = wxEVT_FIRST + 430;
|
|
||||||
const wxEventType wxEVT_JOY_MOVE = wxEVT_FIRST + 431;
|
|
||||||
const wxEventType wxEVT_JOY_ZMOVE = wxEVT_FIRST + 432;
|
|
||||||
const wxEventType wxEVT_DROP_FILES = wxEVT_FIRST + 433;
|
|
||||||
const wxEventType wxEVT_DRAW_ITEM = wxEVT_FIRST + 434;
|
|
||||||
const wxEventType wxEVT_MEASURE_ITEM = wxEVT_FIRST + 435;
|
|
||||||
const wxEventType wxEVT_COMPARE_ITEM = wxEVT_FIRST + 436;
|
|
||||||
const wxEventType wxEVT_INIT_DIALOG = wxEVT_FIRST + 437;
|
|
||||||
const wxEventType wxEVT_IDLE = wxEVT_FIRST + 438;
|
|
||||||
const wxEventType wxEVT_UPDATE_UI = wxEVT_FIRST + 439;
|
|
||||||
|
|
||||||
/* System misc. */
|
|
||||||
const wxEventType wxEVT_END_PROCESS = wxEVT_FIRST + 440;
|
|
||||||
|
|
||||||
/* Dial up events */
|
|
||||||
const wxEventType wxEVT_DIALUP_CONNECTED = wxEVT_FIRST + 450;
|
|
||||||
const wxEventType wxEVT_DIALUP_DISCONNECTED = wxEVT_FIRST + 451;
|
|
||||||
|
|
||||||
/* Generic command events */
|
|
||||||
/* Note: a click is a higher-level event than button down/up */
|
|
||||||
const wxEventType wxEVT_COMMAND_LEFT_CLICK = wxEVT_FIRST + 500;
|
|
||||||
const wxEventType wxEVT_COMMAND_LEFT_DCLICK = wxEVT_FIRST + 501;
|
|
||||||
const wxEventType wxEVT_COMMAND_RIGHT_CLICK = wxEVT_FIRST + 502;
|
|
||||||
const wxEventType wxEVT_COMMAND_RIGHT_DCLICK = wxEVT_FIRST + 503;
|
|
||||||
const wxEventType wxEVT_COMMAND_SET_FOCUS = wxEVT_FIRST + 504;
|
|
||||||
const wxEventType wxEVT_COMMAND_KILL_FOCUS = wxEVT_FIRST + 505;
|
|
||||||
const wxEventType wxEVT_COMMAND_ENTER = wxEVT_FIRST + 506;
|
|
||||||
|
|
||||||
/* Tree control event types */
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_BEGIN_DRAG = wxEVT_FIRST + 600;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_BEGIN_RDRAG = wxEVT_FIRST + 601;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT = wxEVT_FIRST + 602;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_END_LABEL_EDIT = wxEVT_FIRST + 603;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_DELETE_ITEM = wxEVT_FIRST + 604;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_GET_INFO = wxEVT_FIRST + 605;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_SET_INFO = wxEVT_FIRST + 606;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDED = wxEVT_FIRST + 607;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDING = wxEVT_FIRST + 608;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSED = wxEVT_FIRST + 609;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSING = wxEVT_FIRST + 610;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGED = wxEVT_FIRST + 611;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGING = wxEVT_FIRST + 612;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_KEY_DOWN = wxEVT_FIRST + 613;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_ITEM_ACTIVATED = wxEVT_FIRST + 614;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK = wxEVT_FIRST + 615;
|
|
||||||
const wxEventType wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK = wxEVT_FIRST + 616;
|
|
||||||
|
|
||||||
/* List control event types */
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_BEGIN_DRAG = wxEVT_FIRST + 700;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_BEGIN_RDRAG = wxEVT_FIRST + 701;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT = wxEVT_FIRST + 702;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_END_LABEL_EDIT = wxEVT_FIRST + 703;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_DELETE_ITEM = wxEVT_FIRST + 704;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS = wxEVT_FIRST + 705;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_GET_INFO = wxEVT_FIRST + 706;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_SET_INFO = wxEVT_FIRST + 707;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_ITEM_SELECTED = wxEVT_FIRST + 708;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_ITEM_DESELECTED = wxEVT_FIRST + 709;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_KEY_DOWN = wxEVT_FIRST + 710;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_INSERT_ITEM = wxEVT_FIRST + 711;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_COL_CLICK = wxEVT_FIRST + 712;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK = wxEVT_FIRST + 713;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK = wxEVT_FIRST + 714;
|
|
||||||
const wxEventType wxEVT_COMMAND_LIST_ITEM_ACTIVATED = wxEVT_FIRST + 715;
|
|
||||||
|
|
||||||
/* Tab and notebook control event types */
|
|
||||||
const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGED = wxEVT_FIRST + 800;
|
|
||||||
const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGING = wxEVT_FIRST + 801;
|
|
||||||
const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED = wxEVT_FIRST + 802;
|
|
||||||
const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING = wxEVT_FIRST + 803;
|
|
||||||
|
|
||||||
/* Splitter events */
|
|
||||||
const wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED = wxEVT_FIRST + 850;
|
|
||||||
const wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING = wxEVT_FIRST + 851;
|
|
||||||
const wxEventType wxEVT_COMMAND_SPLITTER_DOUBLECLICKED = wxEVT_FIRST + 852;
|
|
||||||
const wxEventType wxEVT_COMMAND_SPLITTER_UNSPLIT = wxEVT_FIRST + 853;
|
|
||||||
|
|
||||||
/* Wizard events */
|
|
||||||
const wxEventType wxEVT_WIZARD_PAGE_CHANGED = wxEVT_FIRST + 900;
|
|
||||||
const wxEventType wxEVT_WIZARD_PAGE_CHANGING = wxEVT_FIRST + 901;
|
|
||||||
const wxEventType wxEVT_WIZARD_CANCEL = wxEVT_FIRST + 902;
|
|
||||||
|
|
||||||
/* Calendar events */
|
|
||||||
const wxEventType wxEVT_CALENDAR_SEL_CHANGED = wxEVT_FIRST + 950;
|
|
||||||
const wxEventType wxEVT_CALENDAR_DAY_CHANGED = wxEVT_FIRST + 951;
|
|
||||||
const wxEventType wxEVT_CALENDAR_MONTH_CHANGED = wxEVT_FIRST + 952;
|
|
||||||
const wxEventType wxEVT_CALENDAR_YEAR_CHANGED = wxEVT_FIRST + 953;
|
|
||||||
const wxEventType wxEVT_CALENDAR_DOUBLECLICKED = wxEVT_FIRST + 954;
|
|
||||||
const wxEventType wxEVT_CALENDAR_WEEKDAY_CLICKED = wxEVT_FIRST + 955;
|
|
||||||
|
|
||||||
const wxEventType wxEVT_USER_FIRST = wxEVT_FIRST + 2000;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxWin macros
|
// wxWin macros
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxEvtHandler, wxObject)
|
IMPLEMENT_DYNAMIC_CLASS(wxEvtHandler, wxObject)
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxEvent, wxObject)
|
IMPLEMENT_ABSTRACT_CLASS(wxEvent, wxObject)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxIdleEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxIdleEvent, wxEvent)
|
||||||
|
|
||||||
#if wxUSE_GUI
|
#if wxUSE_GUI
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxCommandEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxCommandEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxNotifyEvent, wxCommandEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxNotifyEvent, wxCommandEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxScrollEvent, wxCommandEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxScrollEvent, wxCommandEvent)
|
||||||
@@ -298,15 +82,15 @@ const wxEventType wxEVT_USER_FIRST = wxEVT_FIRST + 2000;
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(wxQueryNewPaletteEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxQueryNewPaletteEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxWindowCreateEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxWindowCreateEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxWindowDestroyEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxWindowDestroyEvent, wxEvent)
|
||||||
#endif // wxUSE_GUI
|
#endif // wxUSE_GUI
|
||||||
|
|
||||||
const wxEventTable *wxEvtHandler::GetEventTable() const
|
const wxEventTable *wxEvtHandler::GetEventTable() const
|
||||||
{ return &wxEvtHandler::sm_eventTable; }
|
{ return &wxEvtHandler::sm_eventTable; }
|
||||||
|
|
||||||
const wxEventTable wxEvtHandler::sm_eventTable =
|
const wxEventTable wxEvtHandler::sm_eventTable =
|
||||||
{ (const wxEventTable *)NULL, &wxEvtHandler::sm_eventTableEntries[0] };
|
{ (const wxEventTable *)NULL, &wxEvtHandler::sm_eventTableEntries[0] };
|
||||||
|
|
||||||
const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] =
|
const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] =
|
||||||
{ { 0, 0, 0, (wxObjectEventFunction) NULL, (wxObject*) NULL } };
|
{ { 0, 0, 0, (wxObjectEventFunction) NULL, (wxObject*) NULL } };
|
||||||
|
|
||||||
|
|
||||||
@@ -421,6 +205,19 @@ wxScrollEvent::wxScrollEvent(wxEventType commandType,
|
|||||||
{
|
{
|
||||||
m_extraLong = orient;
|
m_extraLong = orient;
|
||||||
m_commandInt = pos;
|
m_commandInt = pos;
|
||||||
|
<<<<<<< event.cpp
|
||||||
|
m_isScrolling = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxScrollEvent::CopyObject(wxObject& obj_d) const
|
||||||
|
{
|
||||||
|
wxScrollEvent *obj = (wxScrollEvent*)&obj_d;
|
||||||
|
|
||||||
|
wxCommandEvent::CopyObject(obj_d);
|
||||||
|
|
||||||
|
obj->m_isScrolling = m_isScrolling;
|
||||||
|
=======
|
||||||
|
>>>>>>> 1.69
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -210,8 +210,20 @@ void wxLogGui::Flush()
|
|||||||
style = wxICON_INFORMATION;
|
style = wxICON_INFORMATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this is the best we can do here
|
||||||
|
wxWindow *parent = wxTheApp->GetTopWindow();
|
||||||
|
|
||||||
|
size_t nMsgCount = m_aMessages.Count();
|
||||||
|
|
||||||
|
wxString str;
|
||||||
|
if ( nMsgCount == 1 )
|
||||||
|
{
|
||||||
|
str = m_aMessages[0];
|
||||||
|
}
|
||||||
|
else // more than one message
|
||||||
|
{
|
||||||
#if wxUSE_LOG_DIALOG
|
#if wxUSE_LOG_DIALOG
|
||||||
wxLogDialog dlg(wxTheApp->GetTopWindow(),
|
wxLogDialog dlg(parent,
|
||||||
m_aMessages, m_aSeverity, m_aTimes,
|
m_aMessages, m_aSeverity, m_aTimes,
|
||||||
title, style);
|
title, style);
|
||||||
|
|
||||||
@@ -220,12 +232,9 @@ void wxLogGui::Flush()
|
|||||||
Clear();
|
Clear();
|
||||||
|
|
||||||
(void)dlg.ShowModal();
|
(void)dlg.ShowModal();
|
||||||
|
|
||||||
#else // !wxUSE_LOG_DIALOG
|
#else // !wxUSE_LOG_DIALOG
|
||||||
// concatenate all strings (but not too many to not overfill the msg box)
|
// concatenate all strings (but not too many to not overfill the msg box)
|
||||||
wxString str;
|
size_t nLines = 0;
|
||||||
size_t nLines = 0,
|
|
||||||
nMsgCount = m_aMessages.Count();
|
|
||||||
|
|
||||||
// start from the most recent message
|
// start from the most recent message
|
||||||
for ( size_t n = nMsgCount; n > 0; n-- ) {
|
for ( size_t n = nMsgCount; n > 0; n-- ) {
|
||||||
@@ -239,19 +248,24 @@ void wxLogGui::Flush()
|
|||||||
|
|
||||||
str << m_aMessages[n - 1] << wxT("\n");
|
str << m_aMessages[n - 1] << wxT("\n");
|
||||||
}
|
}
|
||||||
|
#endif // wxUSE_LOG_DIALOG/!wxUSE_LOG_DIALOG
|
||||||
|
}
|
||||||
|
|
||||||
wxMessageBox(str, title, wxOK | style);
|
// this catches both cases of 1 message with wxUSE_LOG_DIALOG and any
|
||||||
|
// situation without it
|
||||||
|
if ( !!str )
|
||||||
|
{
|
||||||
|
wxMessageBox(str, title, wxOK | style, parent);
|
||||||
|
|
||||||
// no undisplayed messages whatsoever
|
// no undisplayed messages whatsoever
|
||||||
Clear();
|
Clear();
|
||||||
#endif // wxUSE_LOG_DIALOG/!wxUSE_LOG_DIALOG
|
}
|
||||||
|
|
||||||
// do it here again
|
// do it here again
|
||||||
m_bHasMessages = FALSE;
|
m_bHasMessages = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// the default behaviour is to discard all informational messages if there
|
// log all kinds of messages
|
||||||
// are any errors/warnings.
|
|
||||||
void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t)
|
void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t)
|
||||||
{
|
{
|
||||||
switch ( level ) {
|
switch ( level ) {
|
||||||
@@ -696,12 +710,15 @@ wxLogDialog::wxLogDialog(wxWindow *parent,
|
|||||||
|
|
||||||
btnOk->SetFocus();
|
btnOk->SetFocus();
|
||||||
|
|
||||||
|
// this can't happen any more as we don't use this dialog in this case
|
||||||
|
#if 0
|
||||||
if ( count == 1 )
|
if ( count == 1 )
|
||||||
{
|
{
|
||||||
// no details... it's easier to disable a button than to change the
|
// no details... it's easier to disable a button than to change the
|
||||||
// dialog layout depending on whether we have details or not
|
// dialog layout depending on whether we have details or not
|
||||||
m_btnDetails->Disable();
|
m_btnDetails->Disable();
|
||||||
}
|
}
|
||||||
|
#endif // 0
|
||||||
|
|
||||||
Centre();
|
Centre();
|
||||||
}
|
}
|
||||||
|
@@ -9,6 +9,14 @@
|
|||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// declarations
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// headers
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "dragimag.h"
|
#pragma implementation "dragimag.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -39,12 +47,26 @@
|
|||||||
#include "wx/msw/dragimag.h"
|
#include "wx/msw/dragimag.h"
|
||||||
#include "wx/msw/private.h"
|
#include "wx/msw/private.h"
|
||||||
|
|
||||||
#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__) || defined(wxUSE_NORLANDER_HEADERS)
|
#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__))
|
||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// macros
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxDragImage, wxObject)
|
IMPLEMENT_DYNAMIC_CLASS(wxDragImage, wxObject)
|
||||||
|
|
||||||
|
#define GetHimageList() ((HIMAGELIST) m_hImageList)
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// implementation
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxDragImage ctors/dtor
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
wxDragImage::wxDragImage()
|
wxDragImage::wxDragImage()
|
||||||
{
|
{
|
||||||
m_hImageList = 0;
|
m_hImageList = 0;
|
||||||
@@ -53,8 +75,7 @@ wxDragImage::wxDragImage()
|
|||||||
wxDragImage::~wxDragImage()
|
wxDragImage::~wxDragImage()
|
||||||
{
|
{
|
||||||
if ( m_hImageList )
|
if ( m_hImageList )
|
||||||
ImageList_Destroy((HIMAGELIST) m_hImageList);
|
ImageList_Destroy(GetHimageList());
|
||||||
m_hImageList = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -69,7 +90,7 @@ wxDragImage::~wxDragImage()
|
|||||||
bool wxDragImage::Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& hotspot)
|
bool wxDragImage::Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& hotspot)
|
||||||
{
|
{
|
||||||
if ( m_hImageList )
|
if ( m_hImageList )
|
||||||
ImageList_Destroy((HIMAGELIST) m_hImageList);
|
ImageList_Destroy(GetHimageList());
|
||||||
m_hImageList = 0;
|
m_hImageList = 0;
|
||||||
|
|
||||||
UINT flags = 0;
|
UINT flags = 0;
|
||||||
@@ -84,7 +105,7 @@ bool wxDragImage::Create(const wxBitmap& image, const wxCursor& cursor, const wx
|
|||||||
if ( image.GetMask() )
|
if ( image.GetMask() )
|
||||||
hBitmap2 = (HBITMAP) image.GetMask()->GetMaskBitmap();
|
hBitmap2 = (HBITMAP) image.GetMask()->GetMaskBitmap();
|
||||||
|
|
||||||
int index = ImageList_Add((HIMAGELIST) m_hImageList, hBitmap1, hBitmap2);
|
int index = ImageList_Add(GetHimageList(), hBitmap1, hBitmap2);
|
||||||
if ( index == -1 )
|
if ( index == -1 )
|
||||||
{
|
{
|
||||||
wxLogError(_("Couldn't add an image to the image list."));
|
wxLogError(_("Couldn't add an image to the image list."));
|
||||||
@@ -100,7 +121,7 @@ bool wxDragImage::Create(const wxBitmap& image, const wxCursor& cursor, const wx
|
|||||||
bool wxDragImage::Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& hotspot)
|
bool wxDragImage::Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& hotspot)
|
||||||
{
|
{
|
||||||
if ( m_hImageList )
|
if ( m_hImageList )
|
||||||
ImageList_Destroy((HIMAGELIST) m_hImageList);
|
ImageList_Destroy(GetHimageList());
|
||||||
m_hImageList = 0;
|
m_hImageList = 0;
|
||||||
|
|
||||||
UINT flags = 0;
|
UINT flags = 0;
|
||||||
@@ -112,7 +133,7 @@ bool wxDragImage::Create(const wxIcon& image, const wxCursor& cursor, const wxPo
|
|||||||
|
|
||||||
HICON hIcon = (HICON) image.GetHICON();
|
HICON hIcon = (HICON) image.GetHICON();
|
||||||
|
|
||||||
int index = ImageList_AddIcon((HIMAGELIST) m_hImageList, hIcon);
|
int index = ImageList_AddIcon(GetHimageList(), hIcon);
|
||||||
if ( index == -1 )
|
if ( index == -1 )
|
||||||
{
|
{
|
||||||
wxLogError(_("Couldn't add an image to the image list."));
|
wxLogError(_("Couldn't add an image to the image list."));
|
||||||
@@ -152,7 +173,7 @@ bool wxDragImage::Create(const wxString& str, const wxCursor& cursor, const wxPo
|
|||||||
bool wxDragImage::Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id)
|
bool wxDragImage::Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id)
|
||||||
{
|
{
|
||||||
if ( m_hImageList )
|
if ( m_hImageList )
|
||||||
ImageList_Destroy((HIMAGELIST) m_hImageList);
|
ImageList_Destroy(GetHimageList());
|
||||||
m_hImageList = (WXHIMAGELIST) TreeView_CreateDragImage((HWND) treeCtrl.GetHWND(), (HTREEITEM) (WXHTREEITEM) id);
|
m_hImageList = (WXHIMAGELIST) TreeView_CreateDragImage((HWND) treeCtrl.GetHWND(), (HTREEITEM) (WXHTREEITEM) id);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -161,7 +182,7 @@ bool wxDragImage::Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id)
|
|||||||
bool wxDragImage::Create(const wxListCtrl& listCtrl, long id)
|
bool wxDragImage::Create(const wxListCtrl& listCtrl, long id)
|
||||||
{
|
{
|
||||||
if ( m_hImageList )
|
if ( m_hImageList )
|
||||||
ImageList_Destroy((HIMAGELIST) m_hImageList);
|
ImageList_Destroy(GetHimageList());
|
||||||
POINT pt;
|
POINT pt;
|
||||||
pt.x = 0; pt.y = 0;
|
pt.x = 0; pt.y = 0;
|
||||||
m_hImageList = (WXHIMAGELIST) ListView_CreateDragImage((HWND) listCtrl.GetHWND(), id, & pt);
|
m_hImageList = (WXHIMAGELIST) ListView_CreateDragImage((HWND) listCtrl.GetHWND(), id, & pt);
|
||||||
@@ -169,31 +190,34 @@ bool wxDragImage::Create(const wxListCtrl& listCtrl, long id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Begin drag
|
// Begin drag
|
||||||
bool wxDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* WXUNUSED(window))
|
bool wxDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* window)
|
||||||
{
|
{
|
||||||
wxASSERT_MSG( (m_hImageList != 0), wxT("Image list must not be null in BeginDrag."));
|
wxASSERT_MSG( (m_hImageList != 0), wxT("Image list must not be null in BeginDrag."));
|
||||||
|
|
||||||
bool ret = (ImageList_BeginDrag((HIMAGELIST) m_hImageList, 0, hotspot.x, hotspot.y) != 0);
|
bool ret = (ImageList_BeginDrag(GetHimageList(), 0, hotspot.x, hotspot.y) != 0);
|
||||||
|
|
||||||
wxASSERT_MSG( (ret), wxT("BeginDrag failed."));
|
|
||||||
|
|
||||||
if (!ret)
|
if (!ret)
|
||||||
|
{
|
||||||
|
wxFAIL_MSG( _T("BeginDrag failed.") );
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_cursor.Ok())
|
if (m_cursor.Ok())
|
||||||
{
|
{
|
||||||
// First add the cursor to the image list
|
// First add the cursor to the image list
|
||||||
int cursorIndex = ImageList_AddIcon((HIMAGELIST) m_hImageList, (HICON) m_cursor.GetHCURSOR());
|
int cursorIndex = ImageList_AddIcon(GetHimageList(), (HICON) m_cursor.GetHCURSOR());
|
||||||
|
|
||||||
wxASSERT_MSG( (cursorIndex != -1), wxT("ImageList_AddIcon failed in BeginDrag."));
|
wxASSERT_MSG( (cursorIndex != -1), wxT("ImageList_AddIcon failed in BeginDrag."));
|
||||||
|
|
||||||
if (cursorIndex != -1)
|
if (cursorIndex != -1)
|
||||||
{
|
{
|
||||||
ImageList_SetDragCursorImage((HIMAGELIST) m_hImageList, cursorIndex, m_hotspot.x, m_hotspot.y);
|
ImageList_SetDragCursorImage(GetHimageList(), cursorIndex, m_hotspot.x, m_hotspot.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
::ShowCursor(FALSE);
|
::ShowCursor(FALSE);
|
||||||
|
::SetCapture(GetHwndOf(window));
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -205,6 +229,11 @@ bool wxDragImage::EndDrag(wxWindow* WXUNUSED(window))
|
|||||||
|
|
||||||
ImageList_EndDrag();
|
ImageList_EndDrag();
|
||||||
|
|
||||||
|
if ( !::ReleaseCapture() )
|
||||||
|
{
|
||||||
|
wxLogLastError("ReleaseCapture");
|
||||||
|
}
|
||||||
|
|
||||||
::ShowCursor(TRUE);
|
::ShowCursor(TRUE);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@@ -302,37 +302,44 @@ wxString wxRegKey::GetName(bool bShortPrefix) const
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined( __GNUWIN32_OLD__ )
|
bool wxRegKey::GetKeyInfo(size_t *pnSubKeys,
|
||||||
bool wxRegKey::GetKeyInfo(size_t* pnSubKeys,
|
size_t *pnMaxKeyLen,
|
||||||
size_t* pnMaxKeyLen,
|
size_t *pnValues,
|
||||||
size_t* pnValues,
|
size_t *pnMaxValueLen) const
|
||||||
size_t* pnMaxValueLen) const
|
|
||||||
#else
|
|
||||||
bool wxRegKey::GetKeyInfo(ulong *pnSubKeys,
|
|
||||||
ulong *pnMaxKeyLen,
|
|
||||||
ulong *pnValues,
|
|
||||||
ulong *pnMaxValueLen) const
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
#if defined(__WIN32__) && !defined(__TWIN32__)
|
#if defined(__WIN32__) && !defined(__TWIN32__)
|
||||||
|
|
||||||
|
// old gcc headers incorrectly prototype RegQueryInfoKey()
|
||||||
|
#ifdef __GNUWIN32_OLD__
|
||||||
|
#define REG_PARAM (size_t *)
|
||||||
|
#else
|
||||||
|
#define REG_PARAM (LPDWORD)
|
||||||
|
#endif
|
||||||
|
|
||||||
m_dwLastError = ::RegQueryInfoKey
|
m_dwLastError = ::RegQueryInfoKey
|
||||||
(
|
(
|
||||||
(HKEY) m_hKey,
|
(HKEY) m_hKey,
|
||||||
NULL, // class name
|
NULL, // class name
|
||||||
NULL, // (ptr to) size of class name buffer
|
NULL, // (ptr to) size of class name buffer
|
||||||
RESERVED,
|
RESERVED,
|
||||||
|
REG_PARAM
|
||||||
pnSubKeys, // [out] number of subkeys
|
pnSubKeys, // [out] number of subkeys
|
||||||
|
REG_PARAM
|
||||||
pnMaxKeyLen, // [out] max length of a subkey name
|
pnMaxKeyLen, // [out] max length of a subkey name
|
||||||
NULL, // longest subkey class name
|
NULL, // longest subkey class name
|
||||||
|
REG_PARAM
|
||||||
pnValues, // [out] number of values
|
pnValues, // [out] number of values
|
||||||
|
REG_PARAM
|
||||||
pnMaxValueLen, // [out] max length of a value name
|
pnMaxValueLen, // [out] max length of a value name
|
||||||
NULL, // longest value data
|
NULL, // longest value data
|
||||||
NULL, // security descriptor
|
NULL, // security descriptor
|
||||||
NULL // time of last modification
|
NULL // time of last modification
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#undef REG_PARAM
|
||||||
|
|
||||||
if ( m_dwLastError != ERROR_SUCCESS ) {
|
if ( m_dwLastError != ERROR_SUCCESS ) {
|
||||||
wxLogSysError(m_dwLastError, _("can't get info about registry key '%s'"),
|
wxLogSysError(m_dwLastError, _("Can't get info about registry key '%s'"),
|
||||||
GetName().c_str());
|
GetName().c_str());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -358,7 +365,7 @@ bool wxRegKey::Open()
|
|||||||
HKEY tmpKey;
|
HKEY tmpKey;
|
||||||
m_dwLastError = RegOpenKey((HKEY) m_hRootKey, m_strKey, &tmpKey);
|
m_dwLastError = RegOpenKey((HKEY) m_hRootKey, m_strKey, &tmpKey);
|
||||||
if ( m_dwLastError != ERROR_SUCCESS ) {
|
if ( m_dwLastError != ERROR_SUCCESS ) {
|
||||||
wxLogSysError(m_dwLastError, _("can't open registry key '%s'"),
|
wxLogSysError(m_dwLastError, _("Can't open registry key '%s'"),
|
||||||
GetName().c_str());
|
GetName().c_str());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -383,7 +390,7 @@ bool wxRegKey::Create(bool bOkIfExists)
|
|||||||
HKEY tmpKey;
|
HKEY tmpKey;
|
||||||
m_dwLastError = RegCreateKey((HKEY) m_hRootKey, m_strKey, &tmpKey);
|
m_dwLastError = RegCreateKey((HKEY) m_hRootKey, m_strKey, &tmpKey);
|
||||||
if ( m_dwLastError != ERROR_SUCCESS ) {
|
if ( m_dwLastError != ERROR_SUCCESS ) {
|
||||||
wxLogSysError(m_dwLastError, _("can't create registry key '%s'"),
|
wxLogSysError(m_dwLastError, _("Can't create registry key '%s'"),
|
||||||
GetName().c_str());
|
GetName().c_str());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -400,7 +407,7 @@ bool wxRegKey::Close()
|
|||||||
if ( IsOpened() ) {
|
if ( IsOpened() ) {
|
||||||
m_dwLastError = RegCloseKey((HKEY) m_hKey);
|
m_dwLastError = RegCloseKey((HKEY) m_hKey);
|
||||||
if ( m_dwLastError != ERROR_SUCCESS ) {
|
if ( m_dwLastError != ERROR_SUCCESS ) {
|
||||||
wxLogSysError(m_dwLastError, _("can't close registry key '%s'"),
|
wxLogSysError(m_dwLastError, _("Can't close registry key '%s'"),
|
||||||
GetName().c_str());
|
GetName().c_str());
|
||||||
|
|
||||||
m_hKey = 0;
|
m_hKey = 0;
|
||||||
@@ -414,6 +421,126 @@ bool wxRegKey::Close()
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wxRegKey::RenameValue(const wxChar *szValueOld, const wxChar *szValueNew)
|
||||||
|
{
|
||||||
|
bool ok = TRUE;
|
||||||
|
if ( HasValue(szValueNew) ) {
|
||||||
|
wxLogError(_("Registry value '%s' already exists."), szValueNew);
|
||||||
|
|
||||||
|
ok = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !ok || !CopyValue(szValueOld, *this, szValueNew) ) {
|
||||||
|
wxLogError(_("Failed to rename registry value '%s' to '%s'."),
|
||||||
|
szValueOld, szValueNew);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxRegKey::CopyValue(const wxChar *szValue,
|
||||||
|
wxRegKey& keyDst,
|
||||||
|
const wxChar *szValueNew)
|
||||||
|
{
|
||||||
|
switch ( GetValueType(szValue) ) {
|
||||||
|
case Type_String:
|
||||||
|
{
|
||||||
|
wxString strVal;
|
||||||
|
return QueryValue(szValue, strVal) &&
|
||||||
|
keyDst.SetValue(szValueNew, strVal);
|
||||||
|
}
|
||||||
|
|
||||||
|
case Type_Dword:
|
||||||
|
/* case Type_Dword_little_endian: == Type_Dword */
|
||||||
|
{
|
||||||
|
long dwVal;
|
||||||
|
return QueryValue(szValue, &dwVal) &&
|
||||||
|
keyDst.SetValue(szValueNew, dwVal);
|
||||||
|
}
|
||||||
|
|
||||||
|
// these types are unsupported because I am not sure about how
|
||||||
|
// exactly they should be copied and because they shouldn't
|
||||||
|
// occur among the application keys (supposedly created with
|
||||||
|
// this class)
|
||||||
|
#ifdef __WIN32__
|
||||||
|
case Type_None:
|
||||||
|
case Type_Expand_String:
|
||||||
|
case Type_Binary:
|
||||||
|
case Type_Dword_big_endian:
|
||||||
|
case Type_Link:
|
||||||
|
case Type_Multi_String:
|
||||||
|
case Type_Resource_list:
|
||||||
|
case Type_Full_resource_descriptor:
|
||||||
|
case Type_Resource_requirements_list:
|
||||||
|
#endif // Win32
|
||||||
|
default:
|
||||||
|
wxLogError(_("Can't copy values of unsupported type %d."),
|
||||||
|
GetValueType(szValue));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxRegKey::Copy(const wxString& strNewName)
|
||||||
|
{
|
||||||
|
// create the new key first
|
||||||
|
wxRegKey keyDst(strNewName);
|
||||||
|
bool ok = keyDst.Create(FALSE /* fail if alredy exists */);
|
||||||
|
if ( ok ) {
|
||||||
|
ok = Copy(keyDst);
|
||||||
|
|
||||||
|
// we created the dest key but copying to it failed - delete it
|
||||||
|
if ( !ok ) {
|
||||||
|
(void)keyDst.DeleteSelf();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxRegKey::Copy(wxRegKey& keyDst)
|
||||||
|
{
|
||||||
|
bool ok = TRUE;
|
||||||
|
|
||||||
|
// copy all sub keys to the new location
|
||||||
|
wxString strKey;
|
||||||
|
long lIndex;
|
||||||
|
bool bCont = GetFirstKey(strKey, lIndex);
|
||||||
|
while ( ok && bCont ) {
|
||||||
|
wxRegKey key(*this, strKey);
|
||||||
|
wxString keyName;
|
||||||
|
keyName << GetFullName(&keyDst) << REG_SEPARATOR << strKey;
|
||||||
|
ok = key.Copy(keyName);
|
||||||
|
|
||||||
|
if ( ok )
|
||||||
|
bCont = GetNextKey(strKey, lIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
// copy all values
|
||||||
|
wxString strVal;
|
||||||
|
bCont = GetFirstValue(strVal, lIndex);
|
||||||
|
while ( ok && bCont ) {
|
||||||
|
ok = CopyValue(strVal, keyDst);
|
||||||
|
|
||||||
|
if ( !ok ) {
|
||||||
|
wxLogSysError(m_dwLastError,
|
||||||
|
_("Failed to copy registry value '%s'"),
|
||||||
|
strVal.c_str());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
bCont = GetNextValue(strVal, lIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !ok ) {
|
||||||
|
wxLogError(_("Failed to copy the contents of registry key '%s' to "
|
||||||
|
"'%s'."), GetFullName(this), GetFullName(&keyDst));
|
||||||
|
}
|
||||||
|
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// delete keys/values
|
// delete keys/values
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -464,7 +591,7 @@ bool wxRegKey::DeleteSelf()
|
|||||||
|
|
||||||
m_dwLastError = RegDeleteKey((HKEY) m_hRootKey, m_strKey);
|
m_dwLastError = RegDeleteKey((HKEY) m_hRootKey, m_strKey);
|
||||||
if ( m_dwLastError != ERROR_SUCCESS ) {
|
if ( m_dwLastError != ERROR_SUCCESS ) {
|
||||||
wxLogSysError(m_dwLastError, _("can't delete key '%s'"),
|
wxLogSysError(m_dwLastError, _("Can't delete key '%s'"),
|
||||||
GetName().c_str());
|
GetName().c_str());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -489,7 +616,7 @@ bool wxRegKey::DeleteValue(const wxChar *szValue)
|
|||||||
#if defined(__WIN32__) && !defined(__TWIN32__)
|
#if defined(__WIN32__) && !defined(__TWIN32__)
|
||||||
m_dwLastError = RegDeleteValue((HKEY) m_hKey, WXSTRINGCAST szValue);
|
m_dwLastError = RegDeleteValue((HKEY) m_hKey, WXSTRINGCAST szValue);
|
||||||
if ( m_dwLastError != ERROR_SUCCESS ) {
|
if ( m_dwLastError != ERROR_SUCCESS ) {
|
||||||
wxLogSysError(m_dwLastError, _("can't delete value '%s' from key '%s'"),
|
wxLogSysError(m_dwLastError, _("Can't delete value '%s' from key '%s'"),
|
||||||
szValue, GetName().c_str());
|
szValue, GetName().c_str());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -500,7 +627,7 @@ bool wxRegKey::DeleteValue(const wxChar *szValue)
|
|||||||
// just set the (default and unique) value of the key to ""
|
// just set the (default and unique) value of the key to ""
|
||||||
m_dwLastError = RegSetValue((HKEY) m_hKey, NULL, REG_SZ, "", RESERVED);
|
m_dwLastError = RegSetValue((HKEY) m_hKey, NULL, REG_SZ, "", RESERVED);
|
||||||
if ( m_dwLastError != ERROR_SUCCESS ) {
|
if ( m_dwLastError != ERROR_SUCCESS ) {
|
||||||
wxLogSysError(m_dwLastError, _("can't delete value of key '%s'"),
|
wxLogSysError(m_dwLastError, _("Can't delete value of key '%s'"),
|
||||||
GetName().c_str());
|
GetName().c_str());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -578,7 +705,7 @@ wxRegKey::ValueType wxRegKey::GetValueType(const wxChar *szValue) const
|
|||||||
m_dwLastError = RegQueryValueEx((HKEY) m_hKey, WXSTRINGCAST szValue, RESERVED,
|
m_dwLastError = RegQueryValueEx((HKEY) m_hKey, WXSTRINGCAST szValue, RESERVED,
|
||||||
&dwType, NULL, NULL);
|
&dwType, NULL, NULL);
|
||||||
if ( m_dwLastError != ERROR_SUCCESS ) {
|
if ( m_dwLastError != ERROR_SUCCESS ) {
|
||||||
wxLogSysError(m_dwLastError, _("can't read value of key '%s'"),
|
wxLogSysError(m_dwLastError, _("Can't read value of key '%s'"),
|
||||||
GetName().c_str());
|
GetName().c_str());
|
||||||
return Type_None;
|
return Type_None;
|
||||||
}
|
}
|
||||||
@@ -603,7 +730,7 @@ bool wxRegKey::SetValue(const wxChar *szValue, long lValue)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxLogSysError(m_dwLastError, _("can't set value of '%s'"),
|
wxLogSysError(m_dwLastError, _("Can't set value of '%s'"),
|
||||||
GetFullName(this, szValue));
|
GetFullName(this, szValue));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
#endif
|
#endif
|
||||||
@@ -617,13 +744,13 @@ bool wxRegKey::QueryValue(const wxChar *szValue, long *plValue) const
|
|||||||
m_dwLastError = RegQueryValueEx((HKEY) m_hKey, WXSTRINGCAST szValue, RESERVED,
|
m_dwLastError = RegQueryValueEx((HKEY) m_hKey, WXSTRINGCAST szValue, RESERVED,
|
||||||
&dwType, pBuf, &dwSize);
|
&dwType, pBuf, &dwSize);
|
||||||
if ( m_dwLastError != ERROR_SUCCESS ) {
|
if ( m_dwLastError != ERROR_SUCCESS ) {
|
||||||
wxLogSysError(m_dwLastError, _("can't read value of key '%s'"),
|
wxLogSysError(m_dwLastError, _("Can't read value of key '%s'"),
|
||||||
GetName().c_str());
|
GetName().c_str());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// check that we read the value of right type
|
// check that we read the value of right type
|
||||||
wxASSERT_MSG( dwType == REG_DWORD,
|
wxASSERT_MSG( IsNumericValue(szValue),
|
||||||
wxT("Type mismatch in wxRegKey::QueryValue().") );
|
wxT("Type mismatch in wxRegKey::QueryValue().") );
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -644,13 +771,25 @@ bool wxRegKey::QueryValue(const wxChar *szValue, wxString& strValue) const
|
|||||||
m_dwLastError = RegQueryValueEx((HKEY) m_hKey, WXSTRINGCAST szValue, RESERVED,
|
m_dwLastError = RegQueryValueEx((HKEY) m_hKey, WXSTRINGCAST szValue, RESERVED,
|
||||||
&dwType, NULL, &dwSize);
|
&dwType, NULL, &dwSize);
|
||||||
if ( m_dwLastError == ERROR_SUCCESS ) {
|
if ( m_dwLastError == ERROR_SUCCESS ) {
|
||||||
|
if ( !dwSize ) {
|
||||||
|
// must treat this case specially as GetWriteBuf() doesn't like
|
||||||
|
// being called with 0 size
|
||||||
|
strValue.Empty();
|
||||||
|
}
|
||||||
|
else {
|
||||||
RegString pBuf = (RegString)strValue.GetWriteBuf(dwSize);
|
RegString pBuf = (RegString)strValue.GetWriteBuf(dwSize);
|
||||||
m_dwLastError = RegQueryValueEx((HKEY) m_hKey, WXSTRINGCAST szValue, RESERVED,
|
m_dwLastError = RegQueryValueEx((HKEY) m_hKey,
|
||||||
&dwType, pBuf, &dwSize);
|
WXSTRINGCAST szValue,
|
||||||
|
RESERVED,
|
||||||
|
&dwType,
|
||||||
|
pBuf,
|
||||||
|
&dwSize);
|
||||||
strValue.UngetWriteBuf();
|
strValue.UngetWriteBuf();
|
||||||
|
}
|
||||||
|
|
||||||
if ( m_dwLastError == ERROR_SUCCESS ) {
|
if ( m_dwLastError == ERROR_SUCCESS ) {
|
||||||
// check that it was the right type
|
// check that it was the right type
|
||||||
wxASSERT_MSG( dwType == REG_SZ,
|
wxASSERT_MSG( !IsNumericValue(szValue),
|
||||||
wxT("Type mismatch in wxRegKey::QueryValue().") );
|
wxT("Type mismatch in wxRegKey::QueryValue().") );
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -667,7 +806,7 @@ bool wxRegKey::QueryValue(const wxChar *szValue, wxString& strValue) const
|
|||||||
#endif //WIN16/32
|
#endif //WIN16/32
|
||||||
}
|
}
|
||||||
|
|
||||||
wxLogSysError(m_dwLastError, _("can't read value of '%s'"),
|
wxLogSysError(m_dwLastError, _("Can't read value of '%s'"),
|
||||||
GetFullName(this, szValue));
|
GetFullName(this, szValue));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -691,7 +830,7 @@ bool wxRegKey::SetValue(const wxChar *szValue, const wxString& strValue)
|
|||||||
#endif //WIN16/32
|
#endif //WIN16/32
|
||||||
}
|
}
|
||||||
|
|
||||||
wxLogSysError(m_dwLastError, _("can't set value of '%s'"),
|
wxLogSysError(m_dwLastError, _("Can't set value of '%s'"),
|
||||||
GetFullName(this, szValue));
|
GetFullName(this, szValue));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@@ -743,7 +882,7 @@ bool wxRegKey::GetNextValue(wxString& strValueName, long& lIndex) const
|
|||||||
lIndex = -1;
|
lIndex = -1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
wxLogSysError(m_dwLastError, _("can't enumerate values of key '%s'"),
|
wxLogSysError(m_dwLastError, _("Can't enumerate values of key '%s'"),
|
||||||
GetName().c_str());
|
GetName().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -788,7 +927,7 @@ bool wxRegKey::GetNextKey(wxString& strKeyName, long& lIndex) const
|
|||||||
lIndex = -1;
|
lIndex = -1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
wxLogSysError(m_dwLastError, _("can't enumerate subkeys of key '%s'"),
|
wxLogSysError(m_dwLastError, _("Can't enumerate subkeys of key '%s'"),
|
||||||
GetName().c_str());
|
GetName().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -805,7 +944,7 @@ bool wxRegKey::IsNumericValue(const wxChar *szValue) const
|
|||||||
ValueType type = GetValueType(szValue);
|
ValueType type = GetValueType(szValue);
|
||||||
switch ( type ) {
|
switch ( type ) {
|
||||||
case Type_Dword:
|
case Type_Dword:
|
||||||
case Type_Dword_little_endian:
|
/* case Type_Dword_little_endian: == Type_Dword */
|
||||||
case Type_Dword_big_endian:
|
case Type_Dword_big_endian:
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
@@ -27,7 +27,6 @@
|
|||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/window.h"
|
|
||||||
#include "wx/msw/private.h"
|
#include "wx/msw/private.h"
|
||||||
|
|
||||||
// Mingw32 is a bit mental even though this is done in winundef
|
// Mingw32 is a bit mental even though this is done in winundef
|
||||||
@@ -47,6 +46,8 @@
|
|||||||
#include "wx/treectrl.h"
|
#include "wx/treectrl.h"
|
||||||
#include "wx/settings.h"
|
#include "wx/settings.h"
|
||||||
|
|
||||||
|
#include "wx/msw/dragimag.h"
|
||||||
|
|
||||||
#ifdef __GNUWIN32_OLD__
|
#ifdef __GNUWIN32_OLD__
|
||||||
#include "wx/msw/gnuwin32/extra.h"
|
#include "wx/msw/gnuwin32/extra.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -236,11 +237,24 @@ private:
|
|||||||
wxTreeItemData *m_data;
|
wxTreeItemData *m_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// private functions
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
static HTREEITEM GetItemFromPoint(HWND hwndTV, int x, int y)
|
||||||
|
{
|
||||||
|
TVHITTESTINFO tvht;
|
||||||
|
tvht.pt.x = x;
|
||||||
|
tvht.pt.y = y;
|
||||||
|
|
||||||
|
return TreeView_HitTest(hwndTV, &tvht);
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// macros
|
// macros
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrl, wxControl)
|
IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrl, wxControl)
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// variables
|
// variables
|
||||||
@@ -298,6 +312,7 @@ void wxTreeCtrl::Init()
|
|||||||
m_imageListState = NULL;
|
m_imageListState = NULL;
|
||||||
m_textCtrl = NULL;
|
m_textCtrl = NULL;
|
||||||
m_hasAnyAttr = FALSE;
|
m_hasAnyAttr = FALSE;
|
||||||
|
m_dragImage = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxTreeCtrl::Create(wxWindow *parent,
|
bool wxTreeCtrl::Create(wxWindow *parent,
|
||||||
@@ -1462,6 +1477,62 @@ bool wxTreeCtrl::MSWCommand(WXUINT cmd, WXWORD id)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// we hook into WndProc to process WM_MOUSEMOVE/WM_BUTTONUP messages - as we
|
||||||
|
// only do it during dragging, minimize wxWin overhead (this is important for
|
||||||
|
// WM_MOUSEMOVE as they're a lot of them) by catching Windows messages directly
|
||||||
|
// instead of passing by wxWin events
|
||||||
|
long wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||||
|
{
|
||||||
|
if ( m_dragImage )
|
||||||
|
{
|
||||||
|
switch ( nMsg )
|
||||||
|
{
|
||||||
|
case WM_MOUSEMOVE:
|
||||||
|
{
|
||||||
|
int x = GET_X_LPARAM(lParam),
|
||||||
|
y = GET_Y_LPARAM(lParam);
|
||||||
|
|
||||||
|
m_dragImage->Move(wxPoint(x, y), this);
|
||||||
|
|
||||||
|
HTREEITEM htiTarget = GetItemFromPoint(GetHwnd(), x, y);
|
||||||
|
if ( htiTarget )
|
||||||
|
{
|
||||||
|
// highlight the item as target (hiding drag image is
|
||||||
|
// necessary - otherwise the display will be corrupted)
|
||||||
|
m_dragImage->Hide(this);
|
||||||
|
TreeView_SelectDropTarget(GetHwnd(), htiTarget);
|
||||||
|
m_dragImage->Show(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_LBUTTONUP:
|
||||||
|
case WM_RBUTTONUP:
|
||||||
|
{
|
||||||
|
m_dragImage->EndDrag(this);
|
||||||
|
delete m_dragImage;
|
||||||
|
m_dragImage = NULL;
|
||||||
|
|
||||||
|
// generate the drag end event
|
||||||
|
wxTreeEvent event(wxEVT_COMMAND_TREE_END_DRAG, m_windowId);
|
||||||
|
|
||||||
|
int x = GET_X_LPARAM(lParam),
|
||||||
|
y = GET_Y_LPARAM(lParam);
|
||||||
|
|
||||||
|
event.m_item
|
||||||
|
= (WXHTREEITEM)GetItemFromPoint(GetHwnd(), x, y);
|
||||||
|
event.m_pointDrag = wxPoint(x, y);
|
||||||
|
event.SetEventObject(this);
|
||||||
|
|
||||||
|
(void)GetEventHandler()->ProcessEvent(event);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return wxControl::MSWWindowProc(nMsg, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
// process WM_NOTIFY Windows message
|
// process WM_NOTIFY Windows message
|
||||||
bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
||||||
{
|
{
|
||||||
@@ -1504,6 +1575,11 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
|||||||
|
|
||||||
event.m_item = (WXHTREEITEM) tv->itemNew.hItem;
|
event.m_item = (WXHTREEITEM) tv->itemNew.hItem;
|
||||||
event.m_pointDrag = wxPoint(tv->ptDrag.x, tv->ptDrag.y);
|
event.m_pointDrag = wxPoint(tv->ptDrag.x, tv->ptDrag.y);
|
||||||
|
|
||||||
|
// don't allow dragging by default: the user code must
|
||||||
|
// explicitly say that it wants to allow it to avoid breaking
|
||||||
|
// the old apps
|
||||||
|
event.Veto();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1736,6 +1812,20 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
|||||||
// post processing
|
// post processing
|
||||||
switch ( hdr->code )
|
switch ( hdr->code )
|
||||||
{
|
{
|
||||||
|
case TVN_BEGINDRAG:
|
||||||
|
case TVN_BEGINRDRAG:
|
||||||
|
if ( event.IsAllowed() )
|
||||||
|
{
|
||||||
|
// normally this is impossible because the m_dragImage is
|
||||||
|
// deleted once the drag operation is over
|
||||||
|
wxASSERT_MSG( !m_dragImage, _T("starting to drag once again?") );
|
||||||
|
|
||||||
|
m_dragImage = new wxDragImage(*this, event.m_item);
|
||||||
|
m_dragImage->BeginDrag(wxPoint(0, 0), this);
|
||||||
|
m_dragImage->Show(this);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case TVN_DELETEITEM:
|
case TVN_DELETEITEM:
|
||||||
{
|
{
|
||||||
// NB: we might process this message using wxWindows event
|
// NB: we might process this message using wxWindows event
|
||||||
|
Reference in New Issue
Block a user