#include <oilruler.h>
Public Member Functions | |
OriginGadget () | |
Creates an OILDockingBar object. | |
virtual | ~OriginGadget () |
Destroys an OriginGadget object. | |
BOOL | Create (CCamView *pOwnerView, INT32 id) |
Creates an OriginGadget object. | |
void | ShowGadget (BOOL show) |
Shows or hides this gadget. | |
void | CalcPosFromParentClient (WinRect *lpRect) |
Called by CCamView when its size changes, so it knows where to reposition the OriginGadget. | |
BOOL | GetStatusLineText (String_256 *pText, WinCoord MousePos, CWindowID hWnd) |
if over origin gadget return status line help | |
Static Public Member Functions | |
static TCHAR * | BubbleHelpCallBack (CWindowID hWnd, UINT32 PaneIndex, void *UserData) |
Bubble help call back handler (called some time after call to DoBubbleHelpOn() if mouse ha not moved). | |
Protected Member Functions | |
void | DoPaint (wxDC *pDC) |
Paints the client area of the Origin Gadget Mask plots the origin glyph. | |
void | OnPaint (wxPaintEvent &event) |
Redraws the colour bar. | |
void | OnLButtonDown (wxMouseEvent &event) |
handle left button downs | |
void | OnLButtonDblClk (wxMouseEvent &event) |
handle left button double clicks | |
void | OnRButtonUp (wxMouseEvent &event) |
Handle left button up events - pop-up context sensitive menu. | |
void | OnMouseMove (wxMouseEvent &event) |
handle mouse moves over Origin | |
Protected Attributes | |
CCamView * | m_pOwnerView |
wxBitmap * | pGlyph |
Definition at line 362 of file oilruler.h.
|
Creates an OILDockingBar object.
Definition at line 1972 of file oilruler.cpp. 01973 { 01974 pGlyph = NULL; 01975 pGlyph = CamArtProvider::Get()->FindBitmap(_R(IDB_ORIGINBMP)); //, (CamArtFlags)(CAF_DEFAULT|(Disabled?CAF_GREYED:0))); 01976 }
|
|
Destroys an OriginGadget object.
Definition at line 2002 of file oilruler.cpp.
|
|
Bubble help call back handler (called some time after call to DoBubbleHelpOn() if mouse ha not moved).
Definition at line 2286 of file oilruler.cpp. 02287 { 02288 static String_64 BubbleHelpText(""); 02289 02290 BubbleHelpText.Load(_R(IDS_ORIGIN_BH)); 02291 02292 return (TCHAR*)BubbleHelpText; 02293 }
|
|
Called by CCamView when its size changes, so it knows where to reposition the OriginGadget.
Definition at line 2092 of file oilruler.cpp. 02093 { 02094 wxRect parentRect; 02095 parentRect = m_pOwnerView->GetParentFrame()->GetClientRect(); 02096 02097 lpRect->x = parentRect.x ; 02098 lpRect->y = parentRect.y; 02099 lpRect->SetRightEx(parentRect.x + OILRuler::GetWidth()); 02100 lpRect->SetBottomEx(parentRect.y + OILRuler::GetWidth()); 02101 02102 // we need to take into account camelots new floating toolbar .... 02103 02104 PORTNOTE("ruler", "Removed use of Kernel toolbars") 02105 #if !defined(EXCLUDE_FROM_XARALX) 02106 DockBarType DockBarType;// = DOCKBAR_FLOAT; 02107 KernelBarPos * pKernelBarPos; 02108 02109 // find out where the toolbar is docked 02110 GetMainFrame()->GetBarPosInfo(&(String_32 ("Toolbar")), &DockBarType, &pKernelBarPos); 02111 02112 if (DockBarType == DOCKBAR_FLOAT) 02113 { 02114 RECT MainFrameWindowRect = *lpRect; 02115 //::GetWindowRect (GetSafeHwnd (), &MainFrameWindowRect); 02116 ClientToScreen (&MainFrameWindowRect); 02117 02118 POINT ToolbarTL; 02119 ToolbarTL.x = pKernelBarPos->x; 02120 ToolbarTL.y = pKernelBarPos->y; 02121 02122 if (PtInRect (&MainFrameWindowRect, ToolbarTL)) 02123 { 02124 KernelBarPos NewToolBarPos = *pKernelBarPos; 02125 BaseBar* PtrToToolBar = BaseBar::GetPtrToToolBar (); 02126 02127 INT32 dy = MainFrameWindowRect.bottom - ToolbarTL.y; 02128 INT32 dx = MainFrameWindowRect.right - ToolbarTL.x; 02129 02130 NewToolBarPos.y += dy; 02131 NewToolBarPos.x += dx; 02132 02133 if (PtrToToolBar) 02134 { 02135 PtrToToolBar->MoveBar ((WPARAM) DOCKBAR_FLOAT, (LPARAM) &NewToolBarPos); 02136 } 02137 } 02138 } 02139 #endif 02140 02141 }
|
|
Creates an OriginGadget object.
Definition at line 2154 of file oilruler.cpp. 02155 { 02156 ENSURE(pOwnerView,"DockingBar must have a Parent"); 02157 02158 m_pOwnerView = pOwnerView; 02159 02160 if (!wxWindow::Create(pOwnerView->GetParentFrame(), id, wxDefaultPosition, wxSize(OILRuler::GetWidth(), OILRuler::GetWidth()), wxNO_BORDER)) 02161 return(FALSE); 02162 02163 return TRUE; 02164 }
|
|
Paints the client area of the Origin Gadget Mask plots the origin glyph.
Definition at line 2042 of file oilruler.cpp. 02043 { 02044 // read the necessary colours 02045 wxColour BackCol = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE); 02046 wxColour TopLeft = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNHIGHLIGHT); 02047 wxColour BotRight = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW); 02048 wxColour TextCol = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT); 02049 02050 // get info about client rect 02051 wxRect ClientRect = GetClientRect(); 02052 INT32 left = ClientRect.x; 02053 INT32 top = ClientRect.y; 02054 INT32 width = ClientRect.GetWidth(); 02055 INT32 height = ClientRect.GetHeight(); 02056 INT32 right = left + width; 02057 INT32 bottom = top + height; 02058 02059 // render the background 02060 wxPen penNoOutline(BackCol, 0, wxTRANSPARENT); 02061 pDC->SetPen(penNoOutline); 02062 OILRuler::PatB(pDC, left,top, width,height, BackCol); 02063 02064 pDC->SetBackgroundMode(wxTRANSPARENT); 02065 02066 // plot the little orign bitmap in the centre of this window 02067 INT32 BitmapSize = 15; 02068 INT32 offset = (width-BitmapSize)/2; 02069 pDC->DrawBitmap(*pGlyph, offset, offset, true); 02070 02071 // paint the hi/lo lights 02072 OILRuler::PatB(pDC, left,top, width-1,1, TopLeft); // top 02073 OILRuler::PatB(pDC, left,top, 1,height-1, TopLeft); // left 02074 OILRuler::PatB(pDC, left,bottom, width,-1, BotRight); // bottom 02075 OILRuler::PatB(pDC, right,top, -1,height, BotRight); // right 02076 }
|
|
if over origin gadget return status line help
Definition at line 2309 of file oilruler.cpp. 02310 { 02311 ERROR2IF(pText==NULL,FALSE,"OILRuler::GetStatusLineText() - pText==NULL"); 02312 02313 if (this!=hWnd) 02314 return FALSE; 02315 02316 return (pText->Load(_R(IDS_ORIGIN_SH))!=0); 02317 }
|
|
handle left button double clicks
Definition at line 2219 of file oilruler.cpp. 02220 { 02221 /*UINT32 nFlags =*/ ClickModifiers::SynthesizeMouseEventFlags(event); 02222 wxPoint point = event.GetPosition(); 02223 02224 if (OpResetSpreadOrigin::GetState(NULL,NULL).Greyed==FALSE) 02225 { 02226 OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_RESETSPREADORIGIN); 02227 if (pOpDesc!=NULL) 02228 pOpDesc->Invoke(); 02229 else 02230 ERROR3("OriginGadget::OnLButtonDblClk() - FindOpDescriptor(OPTOKEN_RESETSPREADORIGIN) failed"); 02231 } 02232 }
|
|
handle left button downs
Definition at line 2177 of file oilruler.cpp. 02178 { 02179 UINT32 nFlags = ClickModifiers::SynthesizeMouseEventFlags(event); 02180 wxPoint point = event.GetPosition(); 02181 02182 String_256 OpToken(OPTOKEN_SPREADORIGIN); 02183 02184 if (m_pOwnerView != NULL) 02185 m_pOwnerView->InvokeDragOp(&OpToken, NULL, nFlags, point); 02186 }
|
|
handle mouse moves over Origin
Definition at line 2245 of file oilruler.cpp. 02246 { 02247 // UINT32 nFlags = ClickModifiers::SynthesizeMouseEventFlags(event); 02248 wxPoint MousePos = event.GetPosition(); 02249 02250 static wxPoint OldMousePos = wxPoint(0,0); 02251 if (MousePos==OldMousePos) 02252 return; 02253 02254 PORTNOTE("rulers", "Bubble help removed from OriginGadget") 02255 #if !defined(EXCLUDE_FROM_XARALX) 02256 ControlHelper::DoBubbleHelpOn(GetSafeHwnd(), 0, BubbleHelpCallBack,this); 02257 #endif 02258 02259 StatusLine* pStatusLine=GetApplication()->GetpStatusLine(); 02260 if (pStatusLine) 02261 { 02262 String_256 Text(""); 02263 GetStatusLineText(&Text, WinCoord(MousePos.x, MousePos.y), this); 02264 pStatusLine->UpdateText(&Text, STATUSLINE_SELDESC_STATBAR); 02265 } 02266 02267 OldMousePos = MousePos; 02268 }
|
|
Redraws the colour bar.
Definition at line 2020 of file oilruler.cpp. 02021 { 02022 // Always create this so that the area is validated 02023 wxPaintDC dc(this); 02024 02025 if (!CCamApp::IsDisabled()) 02026 { 02027 DoPaint(&dc); 02028 } 02029 }
|
|
Handle left button up events - pop-up context sensitive menu.
Definition at line 2199 of file oilruler.cpp. 02200 { 02201 // UINT32 nFlags = ClickModifiers::SynthesizeMouseEventFlags(event); 02202 wxPoint point = event.GetPosition(); 02203 02204 OriginContextMenu* pOriginMenu = new OriginContextMenu; 02205 pOriginMenu->Show(); 02206 }
|
|
Shows or hides this gadget.
Definition at line 1988 of file oilruler.cpp.
|
|
Definition at line 391 of file oilruler.h. |
|
Definition at line 393 of file oilruler.h. |