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
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
// Created: 08/04/99
|
// Created: 08/04/99
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) Julian Smart
|
// Copyright: (c) Julian Smart
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef _WX_DRAGIMAG_H_
|
#ifndef _WX_DRAGIMAG_H_
|
||||||
@@ -100,9 +100,8 @@
|
|||||||
|
|
||||||
class WXDLLEXPORT wxDragImage: public wxObject
|
class WXDLLEXPORT wxDragImage: public wxObject
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxDragImage)
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Ctors & dtor
|
// Ctors & dtor
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -133,19 +132,19 @@ public:
|
|||||||
Create(listCtrl, id);
|
Create(listCtrl, id);
|
||||||
}
|
}
|
||||||
~wxDragImage();
|
~wxDragImage();
|
||||||
|
|
||||||
// Attributes
|
// Attributes
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Operations
|
// Operations
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Create a drag image from a bitmap and optional cursor
|
// Create a drag image from a bitmap and optional cursor
|
||||||
bool Create(const wxBitmap& image, const wxCursor& cursor = wxNullCursor, const wxPoint& hotspot = wxPoint(0, 0));
|
bool Create(const wxBitmap& image, const wxCursor& cursor = wxNullCursor, const wxPoint& hotspot = wxPoint(0, 0));
|
||||||
|
|
||||||
// Create a drag image from an icon and optional cursor
|
// Create a drag image from an icon and optional cursor
|
||||||
bool Create(const wxIcon& image, const wxCursor& cursor = wxNullCursor, const wxPoint& hotspot = wxPoint(0, 0));
|
bool Create(const wxIcon& image, const wxCursor& cursor = wxNullCursor, const wxPoint& hotspot = wxPoint(0, 0));
|
||||||
|
|
||||||
// Create a drag image from a string and optional cursor
|
// Create a drag image from a string and optional cursor
|
||||||
bool Create(const wxString& str, const wxCursor& cursor = wxNullCursor, const wxPoint& hotspot = wxPoint(0, 0));
|
bool Create(const wxString& str, const wxCursor& cursor = wxNullCursor, const wxPoint& hotspot = wxPoint(0, 0));
|
||||||
|
|
||||||
@@ -158,10 +157,10 @@ public:
|
|||||||
// Begin drag. hotspot is the location of the drag position relative to the upper-left
|
// Begin drag. hotspot is the location of the drag position relative to the upper-left
|
||||||
// corner of the image.
|
// corner of the image.
|
||||||
bool BeginDrag(const wxPoint& hotspot, wxWindow* window);
|
bool BeginDrag(const wxPoint& hotspot, wxWindow* window);
|
||||||
|
|
||||||
// End drag
|
// End drag
|
||||||
bool EndDrag(wxWindow* window);
|
bool EndDrag(wxWindow* window);
|
||||||
|
|
||||||
// Move the image: call from OnMouseMove. Pt is in window client coordinates if window
|
// Move the image: call from OnMouseMove. Pt is in window client coordinates if window
|
||||||
// is non-NULL, or in screen coordinates if NULL.
|
// is non-NULL, or in screen coordinates if NULL.
|
||||||
bool Move(const wxPoint& pt, wxWindow* window);
|
bool Move(const wxPoint& pt, wxWindow* window);
|
||||||
@@ -171,18 +170,21 @@ public:
|
|||||||
|
|
||||||
// Hide the image
|
// Hide the image
|
||||||
bool Hide(wxWindow* window);
|
bool Hide(wxWindow* window);
|
||||||
|
|
||||||
// Implementation
|
// Implementation
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// 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
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
// Name: msw/registry.h
|
// Name: msw/registry.h
|
||||||
// Purpose: Registry classes and functions
|
// Purpose: Registry classes and functions
|
||||||
// Author: Vadim Zeitlin
|
// Author: Vadim Zeitlin
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: 03.04.198
|
// Created: 03.04.198
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||||
@@ -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
|
||||||
@@ -69,15 +70,17 @@ public:
|
|||||||
// predefined registry keys
|
// predefined registry keys
|
||||||
enum StdKey
|
enum StdKey
|
||||||
{
|
{
|
||||||
HKCR // classes root
|
HKCR // classes root
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
, HKCU, // current user
|
,
|
||||||
HKLM, // local machine
|
HKCU, // current user
|
||||||
HKUSR, // users
|
HKLM, // local machine
|
||||||
HKPD // performance data (@@ NT only?)
|
HKUSR, // users
|
||||||
#if WINVER >= 0x0400
|
HKPD // performance data (WinNT/2K only)
|
||||||
, HKCC, // current config
|
#if WINVER >= 0x0400
|
||||||
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,8 +1,8 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: registry.cpp
|
// Name: regtest.cpp
|
||||||
// Purpose: wxRegKey class demo
|
// Purpose: wxRegKey class demo
|
||||||
// Author: Vadim Zeitlin
|
// Author: Vadim Zeitlin
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: 03.04.98
|
// Created: 03.04.98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||||
@@ -35,9 +35,9 @@
|
|||||||
// application type
|
// application type
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
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,77 +93,79 @@ 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
|
||||||
long m_id; // the id of the tree control item
|
long m_id; // the id of the tree control item
|
||||||
wxString m_strName; // name of the key/value
|
wxString m_strName; // name of the key/value
|
||||||
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
|
// trivial accessors
|
||||||
TreeNode() { m_lDummy = 0; }
|
long Id() const { return m_id; }
|
||||||
|
bool IsRoot() const { return m_pParent == NULL; }
|
||||||
|
bool IsKey() const { return m_bKey; }
|
||||||
|
TreeNode *Parent() const { return m_pParent; }
|
||||||
|
|
||||||
// trivial accessors
|
// notifications
|
||||||
long Id() const { return m_id; }
|
bool OnExpand();
|
||||||
bool IsRoot() const { return m_pParent == NULL; }
|
void OnCollapse();
|
||||||
bool IsKey() const { return m_bKey; }
|
|
||||||
TreeNode *Parent() const { return m_pParent; }
|
|
||||||
|
|
||||||
// notifications
|
// operations
|
||||||
bool OnExpand();
|
void Refresh();
|
||||||
void OnCollapse();
|
bool DeleteChild(TreeNode *child);
|
||||||
|
void DestroyChildren();
|
||||||
|
const char *FullName() const;
|
||||||
|
|
||||||
// operations
|
// get the associated key: make sure the pointer is !NULL
|
||||||
void Refresh() { OnCollapse(); OnExpand(); }
|
wxRegKey& Key() { if ( !m_pKey ) OnExpand(); return *m_pKey; }
|
||||||
void AddDummy();
|
|
||||||
void DestroyChildren();
|
|
||||||
const char *FullName() const;
|
|
||||||
|
|
||||||
// get the associated key: make sure the pointer is !NULL
|
// dtor deletes all children
|
||||||
wxRegKey& Key() { if ( !m_pKey ) OnExpand(); return *m_pKey; }
|
~TreeNode();
|
||||||
|
|
||||||
// dtor deletes all children
|
|
||||||
~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()); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// create a new node and insert it to the tree
|
// create a new node and insert it to the tree
|
||||||
TreeNode *InsertNewTreeNode(TreeNode *pParent,
|
TreeNode *InsertNewTreeNode(TreeNode *pParent,
|
||||||
const wxString& strName,
|
const wxString& strName,
|
||||||
int idImage = RegImageList::ClosedKey,
|
int idImage = RegImageList::ClosedKey,
|
||||||
const wxString *pstrValue = NULL);
|
const wxString *pstrValue = NULL);
|
||||||
// add standard registry keys
|
// add standard registry keys
|
||||||
void AddStdKeys();
|
void AddStdKeys();
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_EVENT_TABLE();
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// the main window of our application
|
// the main window of our application
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
class RegFrame : public wxFrame
|
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);
|
||||||
void OnAbout(wxCommandEvent& event);
|
void OnAbout(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();
|
||||||
|
|
||||||
@@ -197,10 +201,11 @@ enum
|
|||||||
Menu_Collapse,
|
Menu_Collapse,
|
||||||
Menu_Toggle,
|
Menu_Toggle,
|
||||||
Menu_New,
|
Menu_New,
|
||||||
Menu_NewKey,
|
Menu_NewKey,
|
||||||
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,9 +280,9 @@ 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);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -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
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -401,7 +422,7 @@ RegImageList::RegImageList() : wxImageList(16, 16, TRUE)
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// create a new tree item and insert it into the tree
|
// create a new tree item and insert it into the tree
|
||||||
RegTreeCtrl::TreeNode *RegTreeCtrl::InsertNewTreeNode(TreeNode *pParent,
|
RegTreeCtrl::TreeNode *RegTreeCtrl::InsertNewTreeNode(TreeNode *pParent,
|
||||||
const wxString& strName,
|
const wxString& strName,
|
||||||
int idImage,
|
int idImage,
|
||||||
const wxString *pstrValue)
|
const wxString *pstrValue)
|
||||||
@@ -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,17 +448,28 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
RegTreeCtrl::RegTreeCtrl(wxWindow *parent, wxWindowID id)
|
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -520,16 +566,28 @@ void RegTreeCtrl::OnMenuTest()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxLogError("Creation of test keys failed.");
|
wxLogError("Creation of test keys failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegTreeCtrl::OnChar(wxKeyEvent& event)
|
void RegTreeCtrl::OnChar(wxKeyEvent& event)
|
||||||
{
|
{
|
||||||
if ( event.KeyCode() == WXK_DELETE )
|
switch ( event.KeyCode() )
|
||||||
DeleteSelected();
|
{
|
||||||
else
|
case WXK_DELETE:
|
||||||
event.Skip();
|
DeleteSelected();
|
||||||
|
return;
|
||||||
|
|
||||||
|
case WXK_RETURN:
|
||||||
|
if ( event.AltDown() )
|
||||||
|
{
|
||||||
|
ShowProperties();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegTreeCtrl::OnSelChanged(wxTreeEvent& event)
|
void RegTreeCtrl::OnSelChanged(wxTreeEvent& event)
|
||||||
@@ -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
|
|
||||||
if ( !pNode->IsRoot() ) {
|
|
||||||
int idIcon = bExpanding ? RegImageList::OpenedKey
|
|
||||||
: RegImageList::ClosedKey;
|
|
||||||
SetItemImage(pNode->Id(), idIcon);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wxLogStatus("Ok");
|
void RegTreeCtrl::OnBeginDrag(wxTreeEvent& event)
|
||||||
wxSetCursor(*wxSTANDARD_CURSOR);
|
{
|
||||||
|
m_copyOnDrop = event.GetEventType() == wxEVT_COMMAND_TREE_BEGIN_DRAG;
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !ok ) {
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -716,7 +911,7 @@ const char *RegTreeCtrl::TreeNode::FullName() const
|
|||||||
return "Registry Root";
|
return "Registry Root";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// our own registry key might not (yet) exist or we might be a value,
|
// our own registry key might not (yet) exist or we might be a value,
|
||||||
// so just use the parent's and concatenate
|
// so just use the parent's and concatenate
|
||||||
s_strName = Parent()->FullName();
|
s_strName = Parent()->FullName();
|
||||||
s_strName << '\\' << m_strName;
|
s_strName << '\\' << m_strName;
|
||||||
@@ -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
|
||||||
"Confirmation",
|
(
|
||||||
wxICON_QUESTION | wxYES_NO | wxCANCEL, this) != wxYES ) {
|
"Do you really want to delete this %s?",
|
||||||
return;
|
what.c_str()
|
||||||
}
|
),
|
||||||
|
"Confirmation",
|
||||||
// must close key before deleting it
|
wxICON_QUESTION | wxYES_NO | wxCANCEL, this) != wxYES ) {
|
||||||
pCurrent->OnCollapse();
|
return;
|
||||||
|
|
||||||
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->DeleteChild(pCurrent);
|
||||||
pParent->Refresh();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegTreeCtrl::CreateNewKey(const wxString& strName)
|
void RegTreeCtrl::CreateNewKey(const wxString& strName)
|
||||||
@@ -780,7 +964,7 @@ void RegTreeCtrl::CreateNewKey(const wxString& strName)
|
|||||||
TreeNode *pCurrent = (TreeNode *)GetItemData(lCurrent);
|
TreeNode *pCurrent = (TreeNode *)GetItemData(lCurrent);
|
||||||
|
|
||||||
wxCHECK_RET( pCurrent != NULL, "node without data?" );
|
wxCHECK_RET( pCurrent != NULL, "node without data?" );
|
||||||
|
|
||||||
wxASSERT( pCurrent->IsKey() ); // check must have been done before
|
wxASSERT( pCurrent->IsKey() ); // check must have been done before
|
||||||
|
|
||||||
if ( pCurrent->IsRoot() ) {
|
if ( pCurrent->IsRoot() ) {
|
||||||
@@ -799,7 +983,7 @@ void RegTreeCtrl::CreateNewTextValue(const wxString& strName)
|
|||||||
TreeNode *pCurrent = (TreeNode *)GetItemData(lCurrent);
|
TreeNode *pCurrent = (TreeNode *)GetItemData(lCurrent);
|
||||||
|
|
||||||
wxCHECK_RET( pCurrent != NULL, "node without data?" );
|
wxCHECK_RET( pCurrent != NULL, "node without data?" );
|
||||||
|
|
||||||
wxASSERT( pCurrent->IsKey() ); // check must have been done before
|
wxASSERT( pCurrent->IsKey() ); // check must have been done before
|
||||||
|
|
||||||
if ( pCurrent->IsRoot() ) {
|
if ( pCurrent->IsRoot() ) {
|
||||||
@@ -817,7 +1001,7 @@ void RegTreeCtrl::CreateNewBinaryValue(const wxString& strName)
|
|||||||
TreeNode *pCurrent = (TreeNode *)GetItemData(lCurrent);
|
TreeNode *pCurrent = (TreeNode *)GetItemData(lCurrent);
|
||||||
|
|
||||||
wxCHECK_RET( pCurrent != NULL, "node without data?" );
|
wxCHECK_RET( pCurrent != NULL, "node without data?" );
|
||||||
|
|
||||||
wxASSERT( pCurrent->IsKey() ); // check must have been done before
|
wxASSERT( pCurrent->IsKey() ); // check must have been done before
|
||||||
|
|
||||||
if ( pCurrent->IsRoot() ) {
|
if ( pCurrent->IsRoot() ) {
|
||||||
@@ -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();
|
||||||
@@ -837,4 +1064,4 @@ bool RegTreeCtrl::IsKeySelected() const
|
|||||||
wxCHECK( pCurrent != NULL, FALSE );
|
wxCHECK( pCurrent != NULL, FALSE );
|
||||||
|
|
||||||
return pCurrent->IsKey();
|
return pCurrent->IsKey();
|
||||||
}
|
}
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
// source such as opening and closing the data source.
|
// source such as opening and closing the data source.
|
||||||
// Author: Doug Card
|
// Author: Doug Card
|
||||||
// Modified by: George Tasker
|
// Modified by: George Tasker
|
||||||
// Mods: Dec, 1998:
|
// Mods: Dec, 1998:
|
||||||
// -Added support for SQL statement logging and database cataloging
|
// -Added support for SQL statement logging and database cataloging
|
||||||
// Mods: April, 1999
|
// Mods: April, 1999
|
||||||
// -Added QUERY_ONLY mode support to reduce default number of cursors
|
// -Added QUERY_ONLY mode support to reduce default number of cursors
|
||||||
@@ -111,7 +111,7 @@ char *SQLLOGfn = (char*) SQL_LOG_FILENAME;
|
|||||||
// database object is closed. This is necessary if the database
|
// database object is closed. This is necessary if the database
|
||||||
// connection fails so the calling application can show the operator
|
// connection fails so the calling application can show the operator
|
||||||
// why the connection failed. Note: as each wxDB object is closed, it
|
// why the connection failed. Note: as each wxDB object is closed, it
|
||||||
// will overwrite the errors of the previously destroyed wxDB object in
|
// will overwrite the errors of the previously destroyed wxDB object in
|
||||||
// this variable.
|
// this variable.
|
||||||
char DBerrorList[DB_MAX_ERROR_HISTORY][DB_MAX_ERROR_MSG_LEN];
|
char DBerrorList[DB_MAX_ERROR_HISTORY][DB_MAX_ERROR_MSG_LEN];
|
||||||
|
|
||||||
@@ -225,7 +225,7 @@ wxDB::wxDB(HENV &aHenv, bool FwdOnlyCursors)
|
|||||||
fpSqlLog = 0; // Sql Log file pointer
|
fpSqlLog = 0; // Sql Log file pointer
|
||||||
sqlLogState = sqlLogOFF; // By default, logging is turned off
|
sqlLogState = sqlLogOFF; // By default, logging is turned off
|
||||||
nTables = 0;
|
nTables = 0;
|
||||||
|
|
||||||
wxStrcpy(sqlState,"");
|
wxStrcpy(sqlState,"");
|
||||||
wxStrcpy(errorMsg,"");
|
wxStrcpy(errorMsg,"");
|
||||||
nativeError = cbErrorMsg = 0;
|
nativeError = cbErrorMsg = 0;
|
||||||
@@ -256,10 +256,10 @@ wxDB::wxDB(HENV &aHenv, bool FwdOnlyCursors)
|
|||||||
typeInfDate.Precision = 0;
|
typeInfDate.Precision = 0;
|
||||||
typeInfDate.CaseSensitive = 0;
|
typeInfDate.CaseSensitive = 0;
|
||||||
typeInfDate.MaximumScale = 0;
|
typeInfDate.MaximumScale = 0;
|
||||||
|
|
||||||
// Error reporting is turned OFF by default
|
// Error reporting is turned OFF by default
|
||||||
silent = TRUE;
|
silent = TRUE;
|
||||||
|
|
||||||
// Copy the HENV into the db class
|
// Copy the HENV into the db class
|
||||||
henv = aHenv;
|
henv = aHenv;
|
||||||
fwdOnlyCursors = FwdOnlyCursors;
|
fwdOnlyCursors = FwdOnlyCursors;
|
||||||
@@ -454,12 +454,12 @@ 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));
|
||||||
cout << "AUTOCOMMIT: " << (l == SQL_AUTOCOMMIT_OFF ? "OFF" : "ON") << endl;
|
cout << "AUTOCOMMIT: " << (l == SQL_AUTOCOMMIT_OFF ? "OFF" : "ON") << endl;
|
||||||
|
|
||||||
if (SQLGetConnectOption(hdbc, SQL_ODBC_CURSORS, &l) != SQL_SUCCESS)
|
if (SQLGetConnectOption(hdbc, SQL_ODBC_CURSORS, &l) != SQL_SUCCESS)
|
||||||
return(DispAllErrors(henv, hdbc));
|
return(DispAllErrors(henv, hdbc));
|
||||||
cout << "ODBC CURSORS: ";
|
cout << "ODBC CURSORS: ";
|
||||||
@@ -476,7 +476,7 @@ bool wxDB::setConnectionOptions(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
cout << endl;
|
cout << endl;
|
||||||
|
|
||||||
if (SQLGetConnectOption(hdbc, SQL_OPT_TRACE, &l) != SQL_SUCCESS)
|
if (SQLGetConnectOption(hdbc, SQL_OPT_TRACE, &l) != SQL_SUCCESS)
|
||||||
return(DispAllErrors(henv, hdbc));
|
return(DispAllErrors(henv, hdbc));
|
||||||
cout << "TRACING: " << (l == SQL_OPT_TRACE_OFF ? "OFF" : "ON") << endl;
|
cout << "TRACING: " << (l == SQL_OPT_TRACE_OFF ? "OFF" : "ON") << endl;
|
||||||
@@ -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;
|
||||||
@@ -1218,7 +1218,7 @@ int wxDB::TranslateSqlState(const char *SQLState)
|
|||||||
|
|
||||||
} // wxDB::TranslateSqlState()
|
} // wxDB::TranslateSqlState()
|
||||||
|
|
||||||
|
|
||||||
/********** wxDB::Grant() **********/
|
/********** wxDB::Grant() **********/
|
||||||
bool wxDB::Grant(int privileges, const char *tableName, const char *userList)
|
bool wxDB::Grant(int privileges, const char *tableName, const char *userList)
|
||||||
{
|
{
|
||||||
@@ -1286,7 +1286,7 @@ bool wxDB::CreateView(const char *viewName, const char *colList, const char *pSq
|
|||||||
// Build the create view statement
|
// Build the create view statement
|
||||||
sqlStmt = "CREATE VIEW ";
|
sqlStmt = "CREATE VIEW ";
|
||||||
sqlStmt += viewName;
|
sqlStmt += viewName;
|
||||||
|
|
||||||
if (wxStrlen(colList))
|
if (wxStrlen(colList))
|
||||||
{
|
{
|
||||||
sqlStmt += " (";
|
sqlStmt += " (";
|
||||||
@@ -1560,7 +1560,7 @@ wxColInf *wxDB::GetColumns(char *tableName[], const char *userID)
|
|||||||
* userID != "" ... UserID set equal to 'userID'
|
* userID != "" ... UserID set equal to 'userID'
|
||||||
*
|
*
|
||||||
* NOTE: ALL column bindings associated with this wxDB instance are unbound
|
* NOTE: ALL column bindings associated with this wxDB instance are unbound
|
||||||
* by this function. This function should use its own wxDB instance
|
* by this function. This function should use its own wxDB instance
|
||||||
* to avoid undesired unbinding of columns.
|
* to avoid undesired unbinding of columns.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
@@ -1588,7 +1588,7 @@ wxColInf *wxDB::GetColumns(char *tableName[], const char *userID)
|
|||||||
if (Dbms() == dbmsDBASE)
|
if (Dbms() == dbmsDBASE)
|
||||||
UserID = "";
|
UserID = "";
|
||||||
|
|
||||||
// Oracle user names may only be in uppercase, so force
|
// Oracle user names may only be in uppercase, so force
|
||||||
// the name to uppercase
|
// the name to uppercase
|
||||||
if (Dbms() == dbmsORACLE)
|
if (Dbms() == dbmsORACLE)
|
||||||
UserID = UserID.Upper();
|
UserID = UserID.Upper();
|
||||||
@@ -1617,7 +1617,7 @@ wxColInf *wxDB::GetColumns(char *tableName[], const char *userID)
|
|||||||
for (tbl = 0; tableName[tbl]; tbl++)
|
for (tbl = 0; tableName[tbl]; tbl++)
|
||||||
{
|
{
|
||||||
TableName = tableName[tbl];
|
TableName = tableName[tbl];
|
||||||
// Oracle table names are uppercase only, so force
|
// Oracle table names are uppercase only, so force
|
||||||
// the name to uppercase just in case programmer forgot to do this
|
// the name to uppercase just in case programmer forgot to do this
|
||||||
if (Dbms() == dbmsORACLE)
|
if (Dbms() == dbmsORACLE)
|
||||||
TableName = TableName.Upper();
|
TableName = TableName.Upper();
|
||||||
@@ -1720,7 +1720,7 @@ wxColInf *wxDB::GetColumns(char *tableName, int *numCols, const char *userID)
|
|||||||
* userID != "" ... UserID set equal to 'userID'
|
* userID != "" ... UserID set equal to 'userID'
|
||||||
*
|
*
|
||||||
* NOTE: ALL column bindings associated with this wxDB instance are unbound
|
* NOTE: ALL column bindings associated with this wxDB instance are unbound
|
||||||
* by this function. This function should use its own wxDB instance
|
* by this function. This function should use its own wxDB instance
|
||||||
* to avoid undesired unbinding of columns.
|
* to avoid undesired unbinding of columns.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
@@ -1748,7 +1748,7 @@ wxColInf *wxDB::GetColumns(char *tableName, int *numCols, const char *userID)
|
|||||||
if (Dbms() == dbmsDBASE)
|
if (Dbms() == dbmsDBASE)
|
||||||
UserID = "";
|
UserID = "";
|
||||||
|
|
||||||
// Oracle user names may only be in uppercase, so force
|
// Oracle user names may only be in uppercase, so force
|
||||||
// the name to uppercase
|
// the name to uppercase
|
||||||
if (Dbms() == dbmsORACLE)
|
if (Dbms() == dbmsORACLE)
|
||||||
UserID = UserID.Upper();
|
UserID = UserID.Upper();
|
||||||
@@ -1774,7 +1774,7 @@ wxColInf *wxDB::GetColumns(char *tableName, int *numCols, const char *userID)
|
|||||||
}
|
}
|
||||||
|
|
||||||
TableName = tableName;
|
TableName = tableName;
|
||||||
// Oracle table names are uppercase only, so force
|
// Oracle table names are uppercase only, so force
|
||||||
// the name to uppercase just in case programmer forgot to do this
|
// the name to uppercase just in case programmer forgot to do this
|
||||||
if (Dbms() == dbmsORACLE)
|
if (Dbms() == dbmsORACLE)
|
||||||
TableName = TableName.Upper();
|
TableName = TableName.Upper();
|
||||||
@@ -1829,7 +1829,7 @@ wxColInf *wxDB::GetColumns(char *tableName, int *numCols, const char *userID)
|
|||||||
GetData( 6, SQL_C_CHAR, (UCHAR*) colInf[colNo].typeName, 128+1, &cb);
|
GetData( 6, SQL_C_CHAR, (UCHAR*) colInf[colNo].typeName, 128+1, &cb);
|
||||||
GetData( 7, SQL_C_SLONG, (UCHAR*) &colInf[colNo].columnSize, 0, &cb);
|
GetData( 7, SQL_C_SLONG, (UCHAR*) &colInf[colNo].columnSize, 0, &cb);
|
||||||
// BJO 991214 : SQL_C_SSHORT instead of SQL_C_SLONG, otherwise fails on Sparc (probably all 64 bit architectures)
|
// BJO 991214 : SQL_C_SSHORT instead of SQL_C_SLONG, otherwise fails on Sparc (probably all 64 bit architectures)
|
||||||
GetData( 8, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].bufferLength, 0, &cb);
|
GetData( 8, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].bufferLength, 0, &cb);
|
||||||
GetData( 9, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].decimalDigits,0, &cb);
|
GetData( 9, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].decimalDigits,0, &cb);
|
||||||
GetData(10, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].numPrecRadix, 0, &cb);
|
GetData(10, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].numPrecRadix, 0, &cb);
|
||||||
GetData(11, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].nullable, 0, &cb);
|
GetData(11, SQL_C_SSHORT, (UCHAR*) &colInf[colNo].nullable, 0, &cb);
|
||||||
@@ -1892,7 +1892,7 @@ int wxDB::GetColumnCount(char *tableName, const char *userID)
|
|||||||
* userID != "" ... UserID set equal to 'userID'
|
* userID != "" ... UserID set equal to 'userID'
|
||||||
*
|
*
|
||||||
* NOTE: ALL column bindings associated with this wxDB instance are unbound
|
* NOTE: ALL column bindings associated with this wxDB instance are unbound
|
||||||
* by this function. This function should use its own wxDB instance
|
* by this function. This function should use its own wxDB instance
|
||||||
* to avoid undesired unbinding of columns.
|
* to avoid undesired unbinding of columns.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
@@ -1917,7 +1917,7 @@ int wxDB::GetColumnCount(char *tableName, const char *userID)
|
|||||||
if (Dbms() == dbmsDBASE)
|
if (Dbms() == dbmsDBASE)
|
||||||
UserID = "";
|
UserID = "";
|
||||||
|
|
||||||
// Oracle user names may only be in uppercase, so force
|
// Oracle user names may only be in uppercase, so force
|
||||||
// the name to uppercase
|
// the name to uppercase
|
||||||
if (Dbms() == dbmsORACLE)
|
if (Dbms() == dbmsORACLE)
|
||||||
UserID = UserID.Upper();
|
UserID = UserID.Upper();
|
||||||
@@ -1926,7 +1926,7 @@ int wxDB::GetColumnCount(char *tableName, const char *userID)
|
|||||||
// Loop through each table name
|
// Loop through each table name
|
||||||
{
|
{
|
||||||
TableName = tableName;
|
TableName = tableName;
|
||||||
// Oracle table names are uppercase only, so force
|
// Oracle table names are uppercase only, so force
|
||||||
// the name to uppercase just in case programmer forgot to do this
|
// the name to uppercase just in case programmer forgot to do this
|
||||||
if (Dbms() == dbmsORACLE)
|
if (Dbms() == dbmsORACLE)
|
||||||
TableName = TableName.Upper();
|
TableName = TableName.Upper();
|
||||||
@@ -1999,7 +1999,7 @@ wxDbInf *wxDB::GetCatalog(char *userID)
|
|||||||
* userID != "" ... UserID set equal to 'userID'
|
* userID != "" ... UserID set equal to 'userID'
|
||||||
*
|
*
|
||||||
* NOTE: ALL column bindings associated with this wxDB instance are unbound
|
* NOTE: ALL column bindings associated with this wxDB instance are unbound
|
||||||
* by this function. This function should use its own wxDB instance
|
* by this function. This function should use its own wxDB instance
|
||||||
* to avoid undesired unbinding of columns.
|
* to avoid undesired unbinding of columns.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
@@ -2027,7 +2027,7 @@ wxDbInf *wxDB::GetCatalog(char *userID)
|
|||||||
if (Dbms() == dbmsDBASE)
|
if (Dbms() == dbmsDBASE)
|
||||||
UserID = "";
|
UserID = "";
|
||||||
|
|
||||||
// Oracle user names may only be in uppercase, so force
|
// Oracle user names may only be in uppercase, so force
|
||||||
// the name to uppercase
|
// the name to uppercase
|
||||||
if (Dbms() == dbmsORACLE)
|
if (Dbms() == dbmsORACLE)
|
||||||
UserID = UserID.Upper();
|
UserID = UserID.Upper();
|
||||||
@@ -2132,7 +2132,7 @@ bool wxDB::Catalog(const char *userID, const char *fileName)
|
|||||||
* userID != "" ... UserID set equal to 'userID'
|
* userID != "" ... UserID set equal to 'userID'
|
||||||
*
|
*
|
||||||
* NOTE: ALL column bindings associated with this wxDB instance are unbound
|
* NOTE: ALL column bindings associated with this wxDB instance are unbound
|
||||||
* by this function. This function should use its own wxDB instance
|
* by this function. This function should use its own wxDB instance
|
||||||
* to avoid undesired unbinding of columns.
|
* to avoid undesired unbinding of columns.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
@@ -2169,7 +2169,7 @@ bool wxDB::Catalog(const char *userID, const char *fileName)
|
|||||||
if (Dbms() == dbmsDBASE)
|
if (Dbms() == dbmsDBASE)
|
||||||
UserID = "";
|
UserID = "";
|
||||||
|
|
||||||
// Oracle user names may only be in uppercase, so force
|
// Oracle user names may only be in uppercase, so force
|
||||||
// the name to uppercase
|
// the name to uppercase
|
||||||
if (Dbms() == dbmsORACLE)
|
if (Dbms() == dbmsORACLE)
|
||||||
UserID = UserID.Upper();
|
UserID = UserID.Upper();
|
||||||
@@ -2295,13 +2295,13 @@ bool wxDB::TableExists(const char *tableName, const char *userID, const char *ta
|
|||||||
else
|
else
|
||||||
UserID = "";
|
UserID = "";
|
||||||
|
|
||||||
// Oracle user names may only be in uppercase, so force
|
// Oracle user names may only be in uppercase, so force
|
||||||
// the name to uppercase
|
// the name to uppercase
|
||||||
if (Dbms() == dbmsORACLE)
|
if (Dbms() == dbmsORACLE)
|
||||||
UserID = UserID.Upper();
|
UserID = UserID.Upper();
|
||||||
|
|
||||||
TableName = tableName;
|
TableName = tableName;
|
||||||
// Oracle table names are uppercase only, so force
|
// Oracle table names are uppercase only, so force
|
||||||
// the name to uppercase just in case programmer forgot to do this
|
// the name to uppercase just in case programmer forgot to do this
|
||||||
if (Dbms() == dbmsORACLE)
|
if (Dbms() == dbmsORACLE)
|
||||||
TableName = TableName.Upper();
|
TableName = TableName.Upper();
|
||||||
@@ -2434,7 +2434,7 @@ DBMS wxDB::Dbms(void)
|
|||||||
* - Cannot support selecting for update [::CanSelectForUpdate()]. Always returns FALSE
|
* - Cannot support selecting for update [::CanSelectForUpdate()]. Always returns FALSE
|
||||||
*
|
*
|
||||||
* POSTGRES
|
* POSTGRES
|
||||||
* - Does not support the keywords 'ASC' or 'DESC' as of release v6.5.0
|
* - Does not support the keywords 'ASC' or 'DESC' as of release v6.5.0
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -2444,7 +2444,7 @@ DBMS wxDB::Dbms(void)
|
|||||||
wxStrncpy(baseName,dbInf.dbmsName,25);
|
wxStrncpy(baseName,dbInf.dbmsName,25);
|
||||||
if (!wxStricmp(dbInf.dbmsName,"Adaptive Server Anywhere"))
|
if (!wxStricmp(dbInf.dbmsName,"Adaptive Server Anywhere"))
|
||||||
return(dbmsSYBASE_ASA);
|
return(dbmsSYBASE_ASA);
|
||||||
if (!wxStricmp(dbInf.dbmsName,"SQL Server")) // Sybase Adaptive Server
|
if (!wxStricmp(dbInf.dbmsName,"SQL Server")) // Sybase Adaptive Server
|
||||||
return(dbmsSYBASE_ASE);
|
return(dbmsSYBASE_ASE);
|
||||||
if (!wxStricmp(dbInf.dbmsName,"Microsoft SQL Server"))
|
if (!wxStricmp(dbInf.dbmsName,"Microsoft SQL Server"))
|
||||||
return(dbmsMS_SQL_SERVER);
|
return(dbmsMS_SQL_SERVER);
|
||||||
@@ -2559,7 +2559,7 @@ bool WXDLLEXPORT FreeDbConnection(wxDB *pDb)
|
|||||||
void WXDLLEXPORT CloseDbConnections(void)
|
void WXDLLEXPORT CloseDbConnections(void)
|
||||||
{
|
{
|
||||||
DbList *pList, *pNext;
|
DbList *pList, *pNext;
|
||||||
|
|
||||||
// Traverse the linked list closing database connections and freeing memory as I go.
|
// Traverse the linked list closing database connections and freeing memory as I go.
|
||||||
for (pList = PtrBegDbList; pList; pList = pNext)
|
for (pList = PtrBegDbList; pList; pList = pNext)
|
||||||
{
|
{
|
||||||
|
@@ -46,268 +46,52 @@
|
|||||||
#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)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxScrollWinEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxScrollWinEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMouseEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxMouseEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxKeyEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxKeyEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxSizeEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxSizeEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPaintEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxPaintEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxEraseEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxEraseEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMoveEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxMoveEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxFocusEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxFocusEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxCloseEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxCloseEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxShowEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxShowEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMaximizeEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxMaximizeEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxIconizeEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxIconizeEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxMenuEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxJoystickEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxJoystickEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxDropFilesEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxDropFilesEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxActivateEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxActivateEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxInitDialogEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxInitDialogEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxSysColourChangedEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxSysColourChangedEvent, wxEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxUpdateUIEvent, wxCommandEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxUpdateUIEvent, wxCommandEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxNavigationKeyEvent, wxCommandEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxNavigationKeyEvent, wxCommandEvent)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPaletteChangedEvent, wxEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxPaletteChangedEvent, wxEvent)
|
||||||
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,48 +210,62 @@ void wxLogGui::Flush()
|
|||||||
style = wxICON_INFORMATION;
|
style = wxICON_INFORMATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_LOG_DIALOG
|
// this is the best we can do here
|
||||||
wxLogDialog dlg(wxTheApp->GetTopWindow(),
|
wxWindow *parent = wxTheApp->GetTopWindow();
|
||||||
m_aMessages, m_aSeverity, m_aTimes,
|
|
||||||
title, style);
|
|
||||||
|
|
||||||
// clear the message list before showing the dialog because while it's
|
size_t nMsgCount = m_aMessages.Count();
|
||||||
// shown some new messages may appear
|
|
||||||
Clear();
|
|
||||||
|
|
||||||
(void)dlg.ShowModal();
|
|
||||||
|
|
||||||
#else // !wxUSE_LOG_DIALOG
|
|
||||||
// concatenate all strings (but not too many to not overfill the msg box)
|
|
||||||
wxString str;
|
wxString str;
|
||||||
size_t nLines = 0,
|
if ( nMsgCount == 1 )
|
||||||
nMsgCount = m_aMessages.Count();
|
{
|
||||||
|
str = m_aMessages[0];
|
||||||
|
}
|
||||||
|
else // more than one message
|
||||||
|
{
|
||||||
|
#if wxUSE_LOG_DIALOG
|
||||||
|
wxLogDialog dlg(parent,
|
||||||
|
m_aMessages, m_aSeverity, m_aTimes,
|
||||||
|
title, style);
|
||||||
|
|
||||||
// start from the most recent message
|
// clear the message list before showing the dialog because while it's
|
||||||
for ( size_t n = nMsgCount; n > 0; n-- ) {
|
// shown some new messages may appear
|
||||||
// for Windows strings longer than this value are wrapped (NT 4.0)
|
Clear();
|
||||||
const size_t nMsgLineWidth = 156;
|
|
||||||
|
|
||||||
nLines += (m_aMessages[n - 1].Len() + nMsgLineWidth - 1) / nMsgLineWidth;
|
(void)dlg.ShowModal();
|
||||||
|
#else // !wxUSE_LOG_DIALOG
|
||||||
|
// concatenate all strings (but not too many to not overfill the msg box)
|
||||||
|
size_t nLines = 0;
|
||||||
|
|
||||||
if ( nLines > 25 ) // don't put too many lines in message box
|
// start from the most recent message
|
||||||
break;
|
for ( size_t n = nMsgCount; n > 0; n-- ) {
|
||||||
|
// for Windows strings longer than this value are wrapped (NT 4.0)
|
||||||
|
const size_t nMsgLineWidth = 156;
|
||||||
|
|
||||||
str << m_aMessages[n - 1] << wxT("\n");
|
nLines += (m_aMessages[n - 1].Len() + nMsgLineWidth - 1) / nMsgLineWidth;
|
||||||
|
|
||||||
|
if ( nLines > 25 ) // don't put too many lines in message box
|
||||||
|
break;
|
||||||
|
|
||||||
|
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();
|
||||||
}
|
}
|
||||||
|
@@ -6,9 +6,17 @@
|
|||||||
// Created: 08/04/99
|
// Created: 08/04/99
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) Julian Smart
|
// Copyright: (c) Julian Smart
|
||||||
// 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;
|
||||||
@@ -52,9 +74,8 @@ wxDragImage::wxDragImage()
|
|||||||
|
|
||||||
wxDragImage::~wxDragImage()
|
wxDragImage::~wxDragImage()
|
||||||
{
|
{
|
||||||
if ( m_hImageList )
|
if ( m_hImageList )
|
||||||
ImageList_Destroy((HIMAGELIST) m_hImageList);
|
ImageList_Destroy(GetHimageList());
|
||||||
m_hImageList = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -68,24 +89,24 @@ wxDragImage::~wxDragImage()
|
|||||||
// Create a drag image from a bitmap and optional cursor
|
// Create a drag image from a bitmap and optional cursor
|
||||||
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;
|
||||||
bool mask = TRUE; // ?
|
bool mask = TRUE; // ?
|
||||||
if ( mask )
|
if ( mask )
|
||||||
flags |= ILC_MASK;
|
flags |= ILC_MASK;
|
||||||
|
|
||||||
m_hImageList = (WXHIMAGELIST) ImageList_Create(image.GetWidth(), image.GetHeight(), flags, 1, 1);
|
m_hImageList = (WXHIMAGELIST) ImageList_Create(image.GetWidth(), image.GetHeight(), flags, 1, 1);
|
||||||
|
|
||||||
HBITMAP hBitmap1 = (HBITMAP) image.GetHBITMAP();
|
HBITMAP hBitmap1 = (HBITMAP) image.GetHBITMAP();
|
||||||
HBITMAP hBitmap2 = 0;
|
HBITMAP hBitmap2 = 0;
|
||||||
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."));
|
||||||
}
|
}
|
||||||
@@ -95,25 +116,25 @@ bool wxDragImage::Create(const wxBitmap& image, const wxCursor& cursor, const wx
|
|||||||
|
|
||||||
return (index != -1) ;
|
return (index != -1) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a drag image from an icon and optional cursor
|
// Create a drag image from an icon and optional cursor
|
||||||
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;
|
||||||
bool mask = TRUE; // ?
|
bool mask = TRUE; // ?
|
||||||
if ( mask )
|
if ( mask )
|
||||||
flags |= ILC_MASK;
|
flags |= ILC_MASK;
|
||||||
|
|
||||||
m_hImageList = (WXHIMAGELIST) ImageList_Create(image.GetWidth(), image.GetHeight(), flags, 1, 1);
|
m_hImageList = (WXHIMAGELIST) ImageList_Create(image.GetWidth(), image.GetHeight(), flags, 1, 1);
|
||||||
|
|
||||||
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."));
|
||||||
}
|
}
|
||||||
@@ -123,7 +144,7 @@ bool wxDragImage::Create(const wxIcon& image, const wxCursor& cursor, const wxPo
|
|||||||
|
|
||||||
return (index != -1) ;
|
return (index != -1) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a drag image from a string and optional cursor
|
// Create a drag image from a string and optional cursor
|
||||||
bool wxDragImage::Create(const wxString& str, const wxCursor& cursor, const wxPoint& hotspot)
|
bool wxDragImage::Create(const wxString& str, const wxCursor& cursor, const wxPoint& hotspot)
|
||||||
{
|
{
|
||||||
@@ -151,8 +172,8 @@ bool wxDragImage::Create(const wxString& str, const wxCursor& cursor, const wxPo
|
|||||||
// Create a drag image for the given tree control item
|
// Create a drag image for the given tree control item
|
||||||
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;
|
||||||
}
|
}
|
||||||
@@ -160,8 +181,8 @@ bool wxDragImage::Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id)
|
|||||||
// Create a drag image for the given list control item
|
// Create a drag image for the given list control item
|
||||||
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,35 +190,38 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
// End drag
|
// End drag
|
||||||
bool wxDragImage::EndDrag(wxWindow* WXUNUSED(window))
|
bool wxDragImage::EndDrag(wxWindow* WXUNUSED(window))
|
||||||
{
|
{
|
||||||
@@ -205,11 +229,16 @@ bool wxDragImage::EndDrag(wxWindow* WXUNUSED(window))
|
|||||||
|
|
||||||
ImageList_EndDrag();
|
ImageList_EndDrag();
|
||||||
|
|
||||||
|
if ( !::ReleaseCapture() )
|
||||||
|
{
|
||||||
|
wxLogLastError("ReleaseCapture");
|
||||||
|
}
|
||||||
|
|
||||||
::ShowCursor(TRUE);
|
::ShowCursor(TRUE);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move the image: call from OnMouseMove. Pt is in window client coordinates if window
|
// Move the image: call from OnMouseMove. Pt is in window client coordinates if window
|
||||||
// is non-NULL, or in screen coordinates if NULL.
|
// is non-NULL, or in screen coordinates if NULL.
|
||||||
bool wxDragImage::Move(const wxPoint& pt, wxWindow* window)
|
bool wxDragImage::Move(const wxPoint& pt, wxWindow* window)
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
// Name: msw/registry.cpp
|
// Name: msw/registry.cpp
|
||||||
// Purpose: implementation of registry classes and functions
|
// Purpose: implementation of registry classes and functions
|
||||||
// Author: Vadim Zeitlin
|
// Author: Vadim Zeitlin
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: 03.04.98
|
// Created: 03.04.98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||||
@@ -65,8 +65,8 @@ static struct
|
|||||||
const wxChar *szName;
|
const wxChar *szName;
|
||||||
const wxChar *szShortName;
|
const wxChar *szShortName;
|
||||||
}
|
}
|
||||||
aStdKeys[] =
|
aStdKeys[] =
|
||||||
{
|
{
|
||||||
{ HKEY_CLASSES_ROOT, wxT("HKEY_CLASSES_ROOT"), wxT("HKCR") },
|
{ HKEY_CLASSES_ROOT, wxT("HKEY_CLASSES_ROOT"), wxT("HKCR") },
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
{ HKEY_CURRENT_USER, wxT("HKEY_CURRENT_USER"), wxT("HKCU") },
|
{ HKEY_CURRENT_USER, wxT("HKEY_CURRENT_USER"), wxT("HKCU") },
|
||||||
@@ -110,7 +110,7 @@ static inline void RemoveTrailingSeparator(wxString& str);
|
|||||||
static bool KeyExists(WXHKEY hRootKey, const wxChar *szKey);
|
static bool KeyExists(WXHKEY hRootKey, const wxChar *szKey);
|
||||||
|
|
||||||
// combines value and key name (uses static buffer!)
|
// combines value and key name (uses static buffer!)
|
||||||
static const wxChar *GetFullName(const wxRegKey *pKey,
|
static const wxChar *GetFullName(const wxRegKey *pKey,
|
||||||
const wxChar *szValue = NULL);
|
const wxChar *szValue = NULL);
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -124,7 +124,7 @@ static const wxChar *GetFullName(const wxRegKey *pKey,
|
|||||||
const size_t wxRegKey::nStdKeys = WXSIZEOF(aStdKeys);
|
const size_t wxRegKey::nStdKeys = WXSIZEOF(aStdKeys);
|
||||||
|
|
||||||
// @@ should take a `StdKey key', but as it's often going to be used in loops
|
// @@ should take a `StdKey key', but as it's often going to be used in loops
|
||||||
// it would require casts in user code.
|
// it would require casts in user code.
|
||||||
const wxChar *wxRegKey::GetStdKeyName(size_t key)
|
const wxChar *wxRegKey::GetStdKeyName(size_t key)
|
||||||
{
|
{
|
||||||
// return empty string if key is invalid
|
// return empty string if key is invalid
|
||||||
@@ -148,7 +148,7 @@ wxRegKey::StdKey wxRegKey::ExtractKeyName(wxString& strKey)
|
|||||||
HKEY hRootKey = 0;
|
HKEY hRootKey = 0;
|
||||||
size_t ui;
|
size_t ui;
|
||||||
for ( ui = 0; ui < nStdKeys; ui++ ) {
|
for ( ui = 0; ui < nStdKeys; ui++ ) {
|
||||||
if ( strRoot.CmpNoCase(aStdKeys[ui].szName) == 0 ||
|
if ( strRoot.CmpNoCase(aStdKeys[ui].szName) == 0 ||
|
||||||
strRoot.CmpNoCase(aStdKeys[ui].szShortName) == 0 ) {
|
strRoot.CmpNoCase(aStdKeys[ui].szShortName) == 0 ) {
|
||||||
hRootKey = aStdKeys[ui].hkey;
|
hRootKey = aStdKeys[ui].hkey;
|
||||||
break;
|
break;
|
||||||
@@ -175,7 +175,7 @@ wxRegKey::StdKey wxRegKey::GetStdKeyFromHkey(WXHKEY hkey)
|
|||||||
if ( (int) aStdKeys[ui].hkey == (int) hkey )
|
if ( (int) aStdKeys[ui].hkey == (int) hkey )
|
||||||
return (StdKey)ui;
|
return (StdKey)ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxFAIL_MSG(wxT("non root hkey passed to wxRegKey::GetStdKeyFromHkey."));
|
wxFAIL_MSG(wxT("non root hkey passed to wxRegKey::GetStdKeyFromHkey."));
|
||||||
|
|
||||||
return HKCR;
|
return HKCR;
|
||||||
@@ -213,7 +213,7 @@ wxRegKey::wxRegKey(const wxRegKey& keyParent, const wxString& strKey)
|
|||||||
: m_strKey(keyParent.m_strKey)
|
: m_strKey(keyParent.m_strKey)
|
||||||
{
|
{
|
||||||
// combine our name with parent's to get the full name
|
// combine our name with parent's to get the full name
|
||||||
if ( !m_strKey.IsEmpty() &&
|
if ( !m_strKey.IsEmpty() &&
|
||||||
(strKey.IsEmpty() || strKey[0] != REG_SEPARATOR) ) {
|
(strKey.IsEmpty() || strKey[0] != REG_SEPARATOR) ) {
|
||||||
m_strKey += REG_SEPARATOR;
|
m_strKey += REG_SEPARATOR;
|
||||||
}
|
}
|
||||||
@@ -294,7 +294,7 @@ bool wxRegKey::Exists() const
|
|||||||
wxString wxRegKey::GetName(bool bShortPrefix) const
|
wxString wxRegKey::GetName(bool bShortPrefix) const
|
||||||
{
|
{
|
||||||
StdKey key = GetStdKeyFromHkey((StdKey) m_hRootKey);
|
StdKey key = GetStdKeyFromHkey((StdKey) m_hRootKey);
|
||||||
wxString str = bShortPrefix ? aStdKeys[key].szShortName
|
wxString str = bShortPrefix ? aStdKeys[key].szShortName
|
||||||
: aStdKeys[key].szName;
|
: aStdKeys[key].szName;
|
||||||
if ( !m_strKey.IsEmpty() )
|
if ( !m_strKey.IsEmpty() )
|
||||||
str << "\\" << m_strKey;
|
str << "\\" << m_strKey;
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -518,7 +645,7 @@ bool wxRegKey::HasValue(const wxChar *szValue) const
|
|||||||
{
|
{
|
||||||
// this function should be silent, so suppress possible messages from Open()
|
// this function should be silent, so suppress possible messages from Open()
|
||||||
wxLogNull nolog;
|
wxLogNull nolog;
|
||||||
|
|
||||||
#ifdef __WIN32__
|
#ifdef __WIN32__
|
||||||
if ( CONST_CAST Open() ) {
|
if ( CONST_CAST Open() ) {
|
||||||
return RegQueryValueEx((HKEY) m_hKey, WXSTRINGCAST szValue, RESERVED,
|
return RegQueryValueEx((HKEY) m_hKey, WXSTRINGCAST szValue, RESERVED,
|
||||||
@@ -537,7 +664,7 @@ bool wxRegKey::HasValues() const
|
|||||||
{
|
{
|
||||||
// suppress possible messages from GetFirstValue()
|
// suppress possible messages from GetFirstValue()
|
||||||
wxLogNull nolog;
|
wxLogNull nolog;
|
||||||
|
|
||||||
// just call GetFirstValue with dummy parameters
|
// just call GetFirstValue with dummy parameters
|
||||||
wxString str;
|
wxString str;
|
||||||
long l;
|
long l;
|
||||||
@@ -549,7 +676,7 @@ bool wxRegKey::HasSubkeys() const
|
|||||||
{
|
{
|
||||||
// suppress possible messages from GetFirstKey()
|
// suppress possible messages from GetFirstKey()
|
||||||
wxLogNull nolog;
|
wxLogNull nolog;
|
||||||
|
|
||||||
// just call GetFirstKey with dummy parameters
|
// just call GetFirstKey with dummy parameters
|
||||||
wxString str;
|
wxString str;
|
||||||
long l;
|
long l;
|
||||||
@@ -561,7 +688,7 @@ bool wxRegKey::HasSubKey(const wxChar *szKey) const
|
|||||||
{
|
{
|
||||||
// this function should be silent, so suppress possible messages from Open()
|
// this function should be silent, so suppress possible messages from Open()
|
||||||
wxLogNull nolog;
|
wxLogNull nolog;
|
||||||
|
|
||||||
if ( CONST_CAST Open() )
|
if ( CONST_CAST Open() )
|
||||||
return KeyExists(m_hKey, szKey);
|
return KeyExists(m_hKey, szKey);
|
||||||
else
|
else
|
||||||
@@ -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 ) {
|
||||||
RegString pBuf = (RegString)strValue.GetWriteBuf(dwSize);
|
if ( !dwSize ) {
|
||||||
m_dwLastError = RegQueryValueEx((HKEY) m_hKey, WXSTRINGCAST szValue, RESERVED,
|
// must treat this case specially as GetWriteBuf() doesn't like
|
||||||
&dwType, pBuf, &dwSize);
|
// being called with 0 size
|
||||||
strValue.UngetWriteBuf();
|
strValue.Empty();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
RegString pBuf = (RegString)strValue.GetWriteBuf(dwSize);
|
||||||
|
m_dwLastError = RegQueryValueEx((HKEY) m_hKey,
|
||||||
|
WXSTRINGCAST szValue,
|
||||||
|
RESERVED,
|
||||||
|
&dwType,
|
||||||
|
pBuf,
|
||||||
|
&dwSize);
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
@@ -677,7 +816,7 @@ bool wxRegKey::SetValue(const wxChar *szValue, const wxString& strValue)
|
|||||||
if ( CONST_CAST Open() ) {
|
if ( CONST_CAST Open() ) {
|
||||||
#if defined( __WIN32__) && !defined(__TWIN32__)
|
#if defined( __WIN32__) && !defined(__TWIN32__)
|
||||||
m_dwLastError = RegSetValueEx((HKEY) m_hKey, szValue, (DWORD) RESERVED, REG_SZ,
|
m_dwLastError = RegSetValueEx((HKEY) m_hKey, szValue, (DWORD) RESERVED, REG_SZ,
|
||||||
(RegString)strValue.c_str(),
|
(RegString)strValue.c_str(),
|
||||||
strValue.Len() + 1);
|
strValue.Len() + 1);
|
||||||
if ( m_dwLastError == ERROR_SUCCESS )
|
if ( m_dwLastError == ERROR_SUCCESS )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -732,8 +871,8 @@ bool wxRegKey::GetNextValue(wxString& strValueName, long& lIndex) const
|
|||||||
|
|
||||||
m_dwLastError = RegEnumValue((HKEY) m_hKey, lIndex++,
|
m_dwLastError = RegEnumValue((HKEY) m_hKey, lIndex++,
|
||||||
szValueName, &dwValueLen,
|
szValueName, &dwValueLen,
|
||||||
RESERVED,
|
RESERVED,
|
||||||
NULL, // [out] type
|
NULL, // [out] type
|
||||||
NULL, // [out] buffer for value
|
NULL, // [out] buffer for value
|
||||||
NULL); // [i/o] it's length
|
NULL); // [i/o] it's length
|
||||||
|
|
||||||
@@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -801,11 +940,11 @@ bool wxRegKey::GetNextKey(wxString& strKeyName, long& lIndex) const
|
|||||||
|
|
||||||
// returns TRUE if the value contains a number (else it's some string)
|
// returns TRUE if the value contains a number (else it's some string)
|
||||||
bool wxRegKey::IsNumericValue(const wxChar *szValue) const
|
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