1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
|
/*
* This file is part of wxSmith plugin for Code::Blocks Studio
* Copyright (C) 2006-2007 Bartlomiej Swiecki
*
* wxSmith is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* wxSmith is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with wxSmith. If not, see <http://www.gnu.org/licenses/>.
*
* $Revision: 7109 $
* $Id: wxspredefinedids.cpp 7109 2011-04-15 11:53:16Z mortenmacfly $
* $HeadURL: http://svn.code.sf.net/p/codeblocks/code/branches/release-16.xx/src/plugins/contrib/wxSmith/wxwidgets/wxspredefinedids.cpp $
*/
#include "wxspredefinedids.h"
namespace
{
struct IdEntry
{
const wxChar* Name;
wxWindowID Value;
};
#define ID(name) { _T(#name), name },
IdEntry IDs[] =
{
ID(wxID_ANY)
ID(wxID_SEPARATOR)
ID(wxID_OPEN)
ID(wxID_CLOSE)
ID(wxID_NEW)
ID(wxID_SAVE)
ID(wxID_SAVEAS)
ID(wxID_REVERT)
ID(wxID_EXIT)
ID(wxID_UNDO)
ID(wxID_REDO)
ID(wxID_HELP)
ID(wxID_PRINT)
ID(wxID_PRINT_SETUP)
ID(wxID_PREVIEW)
ID(wxID_ABOUT)
ID(wxID_HELP_CONTENTS)
ID(wxID_HELP_COMMANDS)
ID(wxID_HELP_PROCEDURES)
ID(wxID_HELP_CONTEXT)
ID(wxID_CLOSE_ALL)
ID(wxID_PREFERENCES)
ID(wxID_CUT)
ID(wxID_COPY)
ID(wxID_PASTE)
ID(wxID_CLEAR)
ID(wxID_FIND)
ID(wxID_DUPLICATE)
ID(wxID_SELECTALL)
ID(wxID_DELETE)
ID(wxID_REPLACE)
ID(wxID_REPLACE_ALL)
ID(wxID_PROPERTIES)
ID(wxID_VIEW_DETAILS)
ID(wxID_VIEW_LARGEICONS)
ID(wxID_VIEW_SMALLICONS)
ID(wxID_VIEW_LIST)
ID(wxID_VIEW_SORTDATE)
ID(wxID_VIEW_SORTNAME)
ID(wxID_VIEW_SORTSIZE)
ID(wxID_VIEW_SORTTYPE)
ID(wxID_FILE1)
ID(wxID_FILE2)
ID(wxID_FILE3)
ID(wxID_FILE4)
ID(wxID_FILE5)
ID(wxID_FILE6)
ID(wxID_FILE7)
ID(wxID_FILE8)
ID(wxID_FILE9)
ID(wxID_OK)
ID(wxID_CANCEL)
ID(wxID_APPLY)
ID(wxID_YES)
ID(wxID_NO)
ID(wxID_STATIC)
ID(wxID_FORWARD)
ID(wxID_BACKWARD)
ID(wxID_DEFAULT)
ID(wxID_MORE)
ID(wxID_SETUP)
ID(wxID_RESET)
ID(wxID_CONTEXT_HELP)
ID(wxID_YESTOALL)
ID(wxID_NOTOALL)
ID(wxID_ABORT)
ID(wxID_RETRY)
ID(wxID_IGNORE)
ID(wxID_ADD)
ID(wxID_REMOVE)
ID(wxID_UP)
ID(wxID_DOWN)
ID(wxID_HOME)
ID(wxID_REFRESH)
ID(wxID_STOP)
ID(wxID_INDEX)
ID(wxID_BOLD)
ID(wxID_ITALIC)
ID(wxID_JUSTIFY_CENTER)
ID(wxID_JUSTIFY_FILL)
ID(wxID_JUSTIFY_RIGHT)
ID(wxID_JUSTIFY_LEFT)
ID(wxID_UNDERLINE)
ID(wxID_INDENT)
ID(wxID_UNINDENT)
ID(wxID_ZOOM_100)
ID(wxID_ZOOM_FIT)
ID(wxID_ZOOM_IN)
ID(wxID_ZOOM_OUT)
ID(wxID_UNDELETE)
ID(wxID_REVERT_TO_SAVED)
ID(wxID_SYSTEM_MENU)
ID(wxID_CLOSE_FRAME)
ID(wxID_MOVE_FRAME)
ID(wxID_RESIZE_FRAME)
ID(wxID_MAXIMIZE_FRAME)
ID(wxID_ICONIZE_FRAME)
ID(wxID_RESTORE_FRAME)
};
static const int IDsCount = sizeof(IDs) / sizeof(IDs[0]);
}
bool wxsPredefinedIDs::Check(const wxString& Name)
{
// First checking if this is value
long Tmp;
if ( Name.ToLong(&Tmp) ) return true;
// Second - checking array of ids
for ( int i=0; i<IDsCount; i++ )
{
if ( Name == IDs[i].Name ) return true;
}
return false;
}
wxWindowID wxsPredefinedIDs::Value(const wxString& Name)
{
// First trying to convert to number
long Tmp;
if ( Name.ToLong(&Tmp) ) return Tmp;
// Second searching in array of ids
for ( int i=0; i<IDsCount; i++ )
{
if ( Name == IDs[i].Name ) return IDs[i].Value;
}
return wxID_ANY;
}
|