]>
git.saurik.com Git - wxWidgets.git/blob - src/common/stockitem.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: common/stockitem.cpp
3 // Purpose: Stock buttons, menu and toolbar items labels
4 // Author: Vaclav Slavik
8 // Copyright: (c) Vaclav Slavik, 2004
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "stockitem.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
31 #include "wx/stockitem.h"
34 wxString
wxGetStockItemLabel(wxStockItemID item
)
36 #define STOCKITEM(stockid, label) \
42 STOCKITEM(wxSTOCK_ADD
, _("Add"))
43 STOCKITEM(wxSTOCK_APPLY
, _("&Apply"))
44 STOCKITEM(wxSTOCK_BOLD
, _("&Bold"))
45 STOCKITEM(wxSTOCK_CANCEL
, _("&Cancel"))
46 STOCKITEM(wxSTOCK_CLEAR
, _("&Clear"))
47 STOCKITEM(wxSTOCK_CLOSE
, _("&Close"))
48 STOCKITEM(wxSTOCK_COPY
, _("&Copy"))
49 STOCKITEM(wxSTOCK_CUT
, _("Cu&t"))
50 STOCKITEM(wxSTOCK_DELETE
, _("&Delete"))
51 STOCKITEM(wxSTOCK_FIND
, _("&Find"))
52 STOCKITEM(wxSTOCK_FIND_AND_REPLACE
, _("Find and rep&lace"))
53 STOCKITEM(wxSTOCK_GO_BACK
, _("&Back"))
54 STOCKITEM(wxSTOCK_GO_DOWN
, _("&Down"))
55 STOCKITEM(wxSTOCK_GO_FORWARD
, _("&Forward"))
56 STOCKITEM(wxSTOCK_GO_UP
, _("&Up"))
57 STOCKITEM(wxSTOCK_HELP
, _("&Help"))
58 STOCKITEM(wxSTOCK_HOME
, _("&Home"))
59 STOCKITEM(wxSTOCK_INDENT
, _("Indent"))
60 STOCKITEM(wxSTOCK_INDEX
, _("&Index"))
61 STOCKITEM(wxSTOCK_ITALIC
, _("&Italic"))
62 STOCKITEM(wxSTOCK_JUSTIFY_CENTER
, _("Centered"))
63 STOCKITEM(wxSTOCK_JUSTIFY_FILL
, _("Justified"))
64 STOCKITEM(wxSTOCK_JUSTIFY_LEFT
, _("Align Left"))
65 STOCKITEM(wxSTOCK_JUSTIFY_RIGHT
, _("Align Right"))
66 STOCKITEM(wxSTOCK_NEW
, _("&New"))
67 STOCKITEM(wxSTOCK_NO
, _("&No"))
68 STOCKITEM(wxSTOCK_OK
, _("&OK"))
69 STOCKITEM(wxSTOCK_OPEN
, _("&Open"))
70 STOCKITEM(wxSTOCK_PASTE
, _("&Paste"))
71 STOCKITEM(wxSTOCK_PREFERENCES
, _("&Preferences"))
72 STOCKITEM(wxSTOCK_PRINT
, _("&Print"))
73 STOCKITEM(wxSTOCK_PRINT_PREVIEW
, _("Print previe&w"))
74 STOCKITEM(wxSTOCK_PROPERTIES
, _("&Properties"))
75 STOCKITEM(wxSTOCK_QUIT
, _("&Quit"))
76 STOCKITEM(wxSTOCK_REDO
, _("&Redo"))
77 STOCKITEM(wxSTOCK_REFRESH
, _("Refresh"))
78 STOCKITEM(wxSTOCK_REMOVE
, _("Remove"))
79 STOCKITEM(wxSTOCK_REVERT_TO_SAVED
, _("Revert to Saved"))
80 STOCKITEM(wxSTOCK_SAVE
, _("&Save"))
81 STOCKITEM(wxSTOCK_SAVE_AS
, _("Save &As..."))
82 STOCKITEM(wxSTOCK_STOP
, _("&Stop"))
83 STOCKITEM(wxSTOCK_UNDELETE
, _("Undelete"))
84 STOCKITEM(wxSTOCK_UNDERLINE
, _("&Underline"))
85 STOCKITEM(wxSTOCK_UNDO
, _("&Undo"))
86 STOCKITEM(wxSTOCK_UNINDENT
, _("&Unindent"))
87 STOCKITEM(wxSTOCK_YES
, _("&Yes"))
88 STOCKITEM(wxSTOCK_ZOOM_100
, _("&Actual Size"))
89 STOCKITEM(wxSTOCK_ZOOM_FIT
, _("Zoom to &Fit"))
90 STOCKITEM(wxSTOCK_ZOOM_IN
, _("Zoom &In"))
91 STOCKITEM(wxSTOCK_ZOOM_OUT
, _("Zoom &Out"))
95 wxFAIL_MSG( _T("invalid stock item ID") );
101 return wxEmptyString
;
109 const char *wxStockItemToGTK(wxStockItemID item
)
111 #define STOCKITEM(stockid) \
113 return GTK_##stockid;
115 #define STOCKITEM_MISSING(stockid) \
119 #if GTK_CHECK_VERSION(2,4,0)
120 #define STOCKITEM_24(stockid) STOCKITEM(stockid)
122 #define STOCKITEM_24(stockid) STOCKITEM_MISSING(stockid)
128 STOCKITEM(STOCK_APPLY
)
129 STOCKITEM(STOCK_BOLD
)
130 STOCKITEM(STOCK_CANCEL
)
131 STOCKITEM(STOCK_CLEAR
)
132 STOCKITEM(STOCK_CLOSE
)
133 STOCKITEM(STOCK_COPY
)
135 STOCKITEM(STOCK_DELETE
)
136 STOCKITEM(STOCK_FIND
)
137 STOCKITEM(STOCK_FIND_AND_REPLACE
)
138 STOCKITEM(STOCK_GO_BACK
)
139 STOCKITEM(STOCK_GO_DOWN
)
140 STOCKITEM(STOCK_GO_FORWARD
)
141 STOCKITEM(STOCK_GO_UP
)
142 STOCKITEM(STOCK_HELP
)
143 STOCKITEM(STOCK_HOME
)
144 STOCKITEM_24(STOCK_INDENT
)
145 STOCKITEM(STOCK_INDEX
)
146 STOCKITEM(STOCK_ITALIC
)
147 STOCKITEM(STOCK_JUSTIFY_CENTER
)
148 STOCKITEM(STOCK_JUSTIFY_FILL
)
149 STOCKITEM(STOCK_JUSTIFY_LEFT
)
150 STOCKITEM(STOCK_JUSTIFY_RIGHT
)
154 STOCKITEM(STOCK_OPEN
)
155 STOCKITEM(STOCK_PASTE
)
156 STOCKITEM(STOCK_PREFERENCES
)
157 STOCKITEM(STOCK_PRINT
)
158 STOCKITEM(STOCK_PRINT_PREVIEW
)
159 STOCKITEM(STOCK_PROPERTIES
)
160 STOCKITEM(STOCK_QUIT
)
161 STOCKITEM(STOCK_REDO
)
162 STOCKITEM(STOCK_REFRESH
)
163 STOCKITEM(STOCK_REMOVE
)
164 STOCKITEM(STOCK_REVERT_TO_SAVED
)
165 STOCKITEM(STOCK_SAVE
)
166 STOCKITEM(STOCK_SAVE_AS
)
167 STOCKITEM(STOCK_STOP
)
168 STOCKITEM(STOCK_UNDELETE
)
169 STOCKITEM(STOCK_UNDERLINE
)
170 STOCKITEM(STOCK_UNDO
)
171 STOCKITEM_24(STOCK_UNINDENT
)
173 STOCKITEM(STOCK_ZOOM_100
)
174 STOCKITEM(STOCK_ZOOM_FIT
)
175 STOCKITEM(STOCK_ZOOM_IN
)
176 STOCKITEM(STOCK_ZOOM_OUT
)
180 wxFAIL_MSG( _T("invalid stock item ID") );
189 #endif // __WXGTK20__