2001-07-24 11:27:12 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2002-01-18 17:34:01 -05:00
|
|
|
// Name: barhintspl.h
|
|
|
|
// Purpose: cbBarHintsPlugin class declaration
|
2001-07-24 11:27:12 -04:00
|
|
|
// Author: Aleksandras Gluchovas
|
|
|
|
// Modified by:
|
|
|
|
// Created: 30/11/98 (my 22th birthday :-)
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Aleksandras Gluchovas
|
2002-01-21 17:34:42 -05:00
|
|
|
// Licence: wxWindows licence
|
2001-07-24 11:27:12 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __DRAGHINTSPL_G__
|
|
|
|
#define __DRAGHINTSPL_G__
|
|
|
|
|
2002-09-07 08:28:46 -04:00
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
2001-07-24 11:27:12 -04:00
|
|
|
#pragma interface "barhintspl.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/fl/controlbar.h"
|
|
|
|
#include "wx/fl/toolwnd.h"
|
|
|
|
|
|
|
|
/*
|
2002-01-18 17:34:01 -05:00
|
|
|
This class intercepts bar-decoration and sizing events, and draws 3D hints
|
|
|
|
around fixed and flexible bars, similar to those in Microsoft DevStudio 6.x
|
|
|
|
*/
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2003-07-08 16:47:17 -04:00
|
|
|
class WXDLLIMPEXP_FL cbBarHintsPlugin : public cbPluginBase
|
2001-07-24 11:27:12 -04:00
|
|
|
{
|
2002-01-21 17:34:42 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS( cbBarHintsPlugin )
|
2001-07-24 11:27:12 -04:00
|
|
|
|
|
|
|
protected:
|
2002-01-21 17:34:42 -05:00
|
|
|
cbDockPane* mpPane; // is set up temorarely, while handling event
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
cbMiniButton* mBoxes[2];
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
bool mBtnPressed;
|
|
|
|
bool mClosePressed;
|
|
|
|
cbBarInfo* mpClickedBar;
|
|
|
|
bool mDepressed;
|
2001-07-24 11:27:12 -04:00
|
|
|
|
|
|
|
protected:
|
2002-01-21 17:34:42 -05:00
|
|
|
// Helper function: draws a 3D box.
|
|
|
|
void Draw3DBox ( wxDC& dc, const wxPoint& pos, bool pressed );
|
2002-01-18 17:34:01 -05:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Helper function: draws a close box.
|
|
|
|
void DrawCloseBox ( wxDC& dc, const wxPoint& pos, bool pressed );
|
2002-01-18 17:34:01 -05:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Helper function: draws a collapse box.
|
|
|
|
void DrawCollapseBox( wxDC& dc, const wxPoint& pos,
|
|
|
|
bool atLeft, bool disabled, bool pressed );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Helper function: draws grooves.
|
|
|
|
void DrawGrooves ( wxDC& dc, const wxPoint& pos, int length );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Helper function: draws a hint.
|
|
|
|
void DoDrawHint( wxDC& dc, wxRect& rect, int pos, int boxOfs, int grooveOfs, bool isFixed );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Helper function: gets the layout of a hint.
|
|
|
|
void GetHintsLayout( wxRect& rect, cbBarInfo& info,
|
|
|
|
int& boxOfs, int& grooveOfs, int& pos );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Helper function: returns information about the hint under the given position.
|
|
|
|
int HitTestHints( cbBarInfo& info, const wxPoint& pos );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Helper function.
|
|
|
|
void ExcludeHints( wxRect& rect, cbBarInfo& info );
|
|
|
|
|
|
|
|
// Helper function: creates close and collapse boxes.
|
|
|
|
void CreateBoxes();
|
2001-07-24 11:27:12 -04:00
|
|
|
|
|
|
|
public:
|
2002-01-21 17:34:42 -05:00
|
|
|
/* public properties */
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
bool mCloseBoxOn; // default: ON
|
|
|
|
bool mCollapseBoxOn; // default: ON
|
|
|
|
int mGrooveCount; // default: 2 (two shaded bars)
|
|
|
|
int mHintGap; // default: 5 (pixels from above, below, right and left)
|
|
|
|
int mXWeight; // default: 2 (width in pixels of lines which used for drawing cross)
|
2001-07-24 11:27:12 -04:00
|
|
|
|
|
|
|
public:
|
2002-01-21 17:34:42 -05:00
|
|
|
// Default constructor.
|
|
|
|
cbBarHintsPlugin(void);
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Constructor, taking parent frame and pane mask flag.
|
|
|
|
cbBarHintsPlugin( wxFrameLayout* pLayout, int paneMask = wxALL_PANES );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Destructor.
|
2001-07-24 11:27:12 -04:00
|
|
|
~cbBarHintsPlugin();
|
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Set the number of grooves to be shown in the pane.
|
|
|
|
void SetGrooveCount( int nGrooves );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Called to initialize this plugin.
|
|
|
|
void OnInitPlugin();
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Handles a plugin event.
|
|
|
|
void OnSizeBarWindow( cbSizeBarWndEvent& event );
|
2002-01-18 17:34:01 -05:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Handles a plugin event.
|
|
|
|
void OnDrawBarDecorations( cbDrawBarDecorEvent& event );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Handles a plugin event.
|
|
|
|
void OnLeftDown( cbLeftDownEvent& event );
|
2002-01-18 17:34:01 -05:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Handles a plugin event.
|
|
|
|
void OnLeftUp ( cbLeftUpEvent& event );
|
2002-01-18 17:34:01 -05:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
// Handles a plugin event.
|
|
|
|
void OnMotion ( cbMotionEvent& event );
|
2001-07-24 11:27:12 -04:00
|
|
|
|
2002-01-21 17:34:42 -05:00
|
|
|
DECLARE_EVENT_TABLE()
|
2001-07-24 11:27:12 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __DRAGHINTSPL_G__ */
|
|
|
|
|