Files
MagicSetEditor2/src/gui/util.hpp
T
twanvl 51546ca2d8 Changed resource names to be lowercase, and to match the filenames (or what they should be);
Replaced all direct construction of bitmaps and icons using wxBitmap("name") with load_resource_* calls.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@191 0fc631ac-6414-0410-93d0-97cfa31319b6
2007-01-30 18:29:02 +00:00

64 lines
2.4 KiB
C++

//+----------------------------------------------------------------------------+
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
//| Copyright: (C) 2001 - 2006 Twan van Laarhoven |
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
#ifndef HEADER_GUI_UTIL
#define HEADER_GUI_UTIL
/** @file gui/util.hpp
* Utility functions for use in the gui. Most are related to drawing.
*/
// ----------------------------------------------------------------------------- : Includes
#include <util/prec.hpp>
class RotatedDC;
class RealRect;
// ----------------------------------------------------------------------------- : Window related
/// Id of the control that has the focus in the given window, or -1 if no control has the focus
int focused_control(const Window* window);
// ----------------------------------------------------------------------------- : DC related
/// Fill a DC with a single color
void clearDC(DC& dc, const wxBrush& brush);
/// Fill a newly allocated DC with black, if the platform doesn't do so automaticly
void clearDC_black(DC& dc);
/// Draw a checkerboard pattern
void draw_checker(RotatedDC& dc, const RealRect&);
// ----------------------------------------------------------------------------- : Resource related
/// Load an image from a resource
Image load_resource_image(const String& name);
/// Load a cursor from a resource
wxCursor load_resource_cursor(const String& name);
/// Load an icon from a resource
wxIcon load_resource_icon(const String& name);
/// Load an image for use in a toolbar (filename: tool/...) from a resource
wxBitmap load_resource_tool_image(const String& name);
// ----------------------------------------------------------------------------- : Platform look
/// Draws a border for a control *around* a rect
/** Based on wxRendererXP::DrawComboBoxDropButton */
void draw_control_border(Window* win, DC& dc, const wxRect& rect);
/// Draws an arrow for a menu item indicating it has a sub menu
void draw_menu_arrow(Window* win, DC& dc, const wxRect& rect, bool active);
void draw_drop_down_arrow(Window* win, DC& dc, const wxRect& rect, bool active);
// ----------------------------------------------------------------------------- : EOF
#endif