/usr/include/wx-2.8/wx/fl/newbmpbtn.h is in wx2.8-headers 2.8.12.1-6ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | /////////////////////////////////////////////////////////////////////////////
// Name: newbmpbtn.h
// Purpose: wxNewBitmapButton header.
// Author: Aleksandras Gluchovas
// Modified by:
// Created: ??/09/98
// RCS-ID: $Id: newbmpbtn.h 35650 2005-09-23 12:56:45Z MR $
// Copyright: (c) Aleksandras Gluchovas
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __NEWBMPBTN_G__
#define __NEWBMPBTN_G__
#include "wx/button.h"
#include "wx/string.h"
#include "wx/fl/fldefs.h"
// defaults
#define NB_DEFAULT_MARGIN 2
// button label-text alignment types
#define NB_ALIGN_TEXT_RIGHT 0
#define NB_ALIGN_TEXT_BOTTOM 1
#define NB_NO_TEXT 2
#define NB_NO_IMAGE 3
// classes declared in this header file
class WXDLLIMPEXP_FL wxNewBitmapButton;
class WXDLLIMPEXP_FL wxBorderLessBitmapButton;
/*
This is an alternative class to wxBitmapButton. It is used
in the implementation of dynamic toolbars.
*/
class wxNewBitmapButton: public wxPanel
{
DECLARE_DYNAMIC_CLASS(wxNewBitmapButton)
protected:
friend class wxNewBitmapButtonSerializer;
int mTextToLabelGap;
int mMarginX;
int mMarginY;
int mTextAlignment;
bool mIsSticky;
bool mIsFlat;
wxString mLabelText;
wxString mImageFileName;
wxBitmapType mImageFileType;
wxBitmap mDepressedBmp; // source image for rendering
// labels for particular state
wxBitmap mFocusedBmp; // may not be always present -
// only if mHasFocusedBmp is true
wxBitmap* mpDepressedImg;
wxBitmap* mpPressedImg;
wxBitmap* mpDisabledImg;
wxBitmap* mpFocusedImg;
// button state variables;
bool mDragStarted;
bool mIsPressed;
bool mIsInFocus;
bool mIsToggled;
bool mHasFocusedBmp;
// type of event which is fired upon depression of this button
int mFiredEventType;
// pens for drawing decorations (borders)
wxPen mBlackPen;
wxPen mDarkPen;
wxPen mGrayPen;
wxPen mLightPen;
bool mIsCreated;
int mSizeIsSet;
protected:
// Internal function for destroying labels.
void DestroyLabels();
// Returns the label that matches the current button state.
virtual wxBitmap* GetStateLabel();
// Draws shading on the button.
virtual void DrawShade( int outerLevel,
wxDC& dc,
wxPen& upperLeftSidePen,
wxPen& lowerRightSidePen );
// Returns true if the given point is in the window.
bool IsInWindow( int x, int y );
virtual void OnIdle(wxIdleEvent& event);
// (EVT_UPDATE_UI handler)
virtual void DoButtonUpdate();
public:
// Constructor.
wxNewBitmapButton( const wxBitmap& labelBitmap = wxNullBitmap,
const wxString& labelText = wxT(""),
int alignText = NB_ALIGN_TEXT_BOTTOM,
bool isFlat = true,
// this is the default type of fired events
int firedEventType = wxEVT_COMMAND_MENU_SELECTED,
int marginX = NB_DEFAULT_MARGIN,
int marginY = NB_DEFAULT_MARGIN,
int textToLabelGap = 2,
bool isSticky = false
);
// Use this constructor if buttons have to be persistant
wxNewBitmapButton( const wxString& bitmapFileName,
const wxBitmapType bitmapFileType = wxBITMAP_TYPE_BMP,
const wxString& labelText = wxT(""),
int alignText = NB_ALIGN_TEXT_BOTTOM,
bool isFlat = true,
// this is the default type of fired events
int firedEventType = wxEVT_COMMAND_MENU_SELECTED,
int marginX = NB_DEFAULT_MARGIN,
int marginY = NB_DEFAULT_MARGIN,
int textToLabelGap = 2,
bool isSticky = false
);
// Destructor.
~wxNewBitmapButton();
// This function should be called after Create. It renders the labels, having
// reloaded the button image if necessary.
virtual void Reshape();
// Sets the label and optionally label text.
virtual void SetLabel(const wxBitmap& labelBitmap, const wxString& labelText = wxT("") );
// Unhide method from parents.
virtual void SetLabel(const wxString& label)
{ wxPanel::SetLabel(label); };
// Sets the text alignment and margins.
virtual void SetAlignments( int alignText = NB_ALIGN_TEXT_BOTTOM,
int marginX = NB_DEFAULT_MARGIN,
int marginY = NB_DEFAULT_MARGIN,
int textToLabelGap = 2);
// Draws the decorations.
virtual void DrawDecorations( wxDC& dc );
// Draws the label.
virtual void DrawLabel( wxDC& dc );
// Renders the label image.
virtual void RenderLabelImage( wxBitmap*& destBmp, wxBitmap* srcBmp,
bool isEnabled = true,
bool isPressed = false);
// Renders label images.
virtual void RenderLabelImages();
// Renders label images.
virtual void RenderAllLabelImages();
// Enables/disables button
virtual bool Enable(bool enable);
// Depress button
virtual bool Toggle(bool enable);
// Responds to a left mouse button down event.
void OnLButtonDown( wxMouseEvent& event );
// Responds to a left mouse button up event.
void OnLButtonUp( wxMouseEvent& event );
// Responds to mouse enter to window.
void OnMouseEnter( wxMouseEvent& event );
// Responds to mouse leave from window.
void OnMouseLeave( wxMouseEvent& event );
// Responds to a size event.
void OnSize( wxSizeEvent& event );
// Responds to a paint event.
void OnPaint( wxPaintEvent& event );
// Responds to an erase background event.
void OnEraseBackground( wxEraseEvent& event );
// Responds to a kill focus event.
void OnKillFocus( wxFocusEvent& event );
DECLARE_EVENT_TABLE()
};
#endif /* __NEWBMPBTN_G__ */
|