[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
[XaraXtreme-commits] Commit Complete
Commit by : alex
Repository : xara
Revision : 970
Date : Sun May 7 19:54:43 BST 2006
Changed paths:
M /Trunk/XaraLX/Kernel/app.cpp
M /Trunk/XaraLX/Kernel/bmapprev.cpp
M /Trunk/XaraLX/Kernel/bmpexprw.cpp
M /Trunk/XaraLX/Kernel/coldlog.cpp
M /Trunk/XaraLX/Kernel/dialogop.cpp
M /Trunk/XaraLX/Kernel/dialogop.h
M /Trunk/XaraLX/Kernel/docview.cpp
M /Trunk/XaraLX/Kernel/exprview.cpp
M /Trunk/XaraLX/Kernel/guides.cpp
M /Trunk/XaraLX/Kernel/rgnlist.cpp
M /Trunk/XaraLX/Kernel/snap.cpp
M /Trunk/XaraLX/Kernel/statline.cpp
M /Trunk/XaraLX/Kernel/statline.h
M /Trunk/XaraLX/Kernel/stdbars.cpp
M /Trunk/XaraLX/Kernel/stdbars.h
M /Trunk/XaraLX/wxOil/camelot.cpp
M /Trunk/XaraLX/wxOil/camframe.cpp
M /Trunk/XaraLX/wxOil/camview.cpp
M /Trunk/XaraLX/wxOil/cartctl.cpp
M /Trunk/XaraLX/wxOil/cartctl.h
M /Trunk/XaraLX/wxOil/ccolbar.cpp
M /Trunk/XaraLX/wxOil/cstatbar.cpp
M /Trunk/XaraLX/wxOil/ctrlhelp.cpp
M /Trunk/XaraLX/wxOil/dlgmgr.cpp
M /Trunk/XaraLX/wxOil/dlgmgr.h
M /Trunk/XaraLX/wxOil/oilruler.cpp
M /Trunk/XaraLX/wxOil/scrvw.cpp
A /Trunk/XaraLX/wxOil/xrc/EN/statusbar.xrc
M /Trunk/XaraLX/wxOil/xrc/EN/xaralxonly-strings.xrc
M /Trunk/XaraLX/wxOil/xrc/SHARED_MENU.res
First attempt at a status bar. Not doing anything useful yet.
Diff:
Index: Trunk/XaraLX/Kernel/app.cpp
===================================================================
--- Trunk/XaraLX/Kernel/app.cpp (revision 969)
+++ Trunk/XaraLX/Kernel/app.cpp (revision 970)
@@ -266,12 +266,6 @@
pDocument = (Document *) Documents.GetHead();
}
- if (m_pStatusLine)
- {
- delete m_pStatusLine;
- m_pStatusLine = NULL;
- }
-
// ERROR3IF(DocComponentClasses != NULL,
// "Application was not properly de-initialised");
if (DocComponentClasses != 0) TRACE( wxT("WARNING: Application was not properly de-initialised
") );
@@ -491,9 +485,6 @@
if (DocComponentClasses == NULL)
return FALSE;
- // Temporary: Remove when Kernel StatusLine is actually created by Oil statusline
- m_pStatusLine = new StatusLine;
-
// Eveything worked (gasp!)
return TRUE;
}
@@ -1674,20 +1665,7 @@
StatusLine* Application::GetpStatusLine()
{
-PORTNOTE("statusline", "getpStatusLine returning disconnected Kernel StatusLine while there is no Oil version");
-#ifndef EXCLUDE_FROM_XARALX
- CMainFrame* mfwindow=(CMainFrame*)(AfxGetApp()->m_pMainWnd);
-
-// ERROR2IF(mfwindow==NULL,NULL,"Application::GetpStatusLinet() - mfwindow==NULL");
- if (mfwindow==NULL)
- return NULL;
-
- return mfwindow->GetpStatusLine();
-#else
- // This is only temporary
- return m_pStatusLine;
-
-#endif
+ return StatusLine::Get();
}
Index: Trunk/XaraLX/Kernel/docview.cpp
===================================================================
--- Trunk/XaraLX/Kernel/docview.cpp (revision 969)
+++ Trunk/XaraLX/Kernel/docview.cpp (revision 970)
@@ -850,7 +850,7 @@
#endif
// update indicator in StatusLine
StatusLine* pStatusLine=GetApplication()->GetpStatusLine();
- ERROR3IF(pStatusLine==NULL,"DocView::Init() - GetpStatusLine() returned NULL!");
+
if (pStatusLine)
pStatusLine->UpdateSolidDragIndicator(m_bSolidDragSupported, DocView::SolidDragging);
@@ -1482,7 +1482,7 @@
// update indicator in StatusLine
StatusLine* pStatusLine=GetApplication()->GetpStatusLine();
- ERROR3IF(pStatusLine==NULL,"DocView::Init() - GetpStatusLine() returned NULL!");
+
if (pStatusLine)
pStatusLine->UpdateSolidDragIndicator(m_bSolidDragSupported, DocView::SolidDragging);
@@ -3516,7 +3516,7 @@
// update indicator in StatusLine
StatusLine* pStatusLine=GetApplication()->GetpStatusLine();
- ERROR3IF(pStatusLine==NULL,"DocView::OnMouseMove() - GetpStatusLine() returned NULL!");
+
if (pStatusLine)
pStatusLine->UpdateSolidDragIndicator(m_bSolidDragSupported, m_bSolidDrag);
break;
Index: Trunk/XaraLX/Kernel/coldlog.cpp
===================================================================
--- Trunk/XaraLX/Kernel/coldlog.cpp (revision 969)
+++ Trunk/XaraLX/Kernel/coldlog.cpp (revision 970)
@@ -1807,11 +1807,10 @@
OriginalColour = *ResultColour;
StatusLine* pStatusLine = GetMainFrame ()->GetpStatusLine ();
- ASSERT (pStatusLine);
if (EditingColour->IsNamed())
{
- if (pStatusLine->IsRestrictedAccessToColourPicker () == FALSE)
+ if (!pStatusLine || pStatusLine->IsRestrictedAccessToColourPicker () == FALSE)
{
if (AutoModelChangeN)
DisplayModel = OriginalColour.GetColourModel();
@@ -1821,7 +1820,7 @@
}
else
{
- if (pStatusLine->IsRestrictedAccessToColourPicker () == FALSE)
+ if (!pStatusLine || pStatusLine->IsRestrictedAccessToColourPicker () == FALSE)
{
if (AutoModelChange)
DisplayModel = OriginalColour.GetColourModel();
@@ -3016,7 +3015,7 @@
case DIM_CANCEL: // Cancel clicked
{
StatusLine* pStatusLine = GetMainFrame ()->GetpStatusLine ();
- if (pStatusLine->IsRestrictedAccessToColourPicker () == FALSE)
+ if (!pStatusLine || pStatusLine->IsRestrictedAccessToColourPicker () == FALSE)
{
CloseMyself(); // And close the window
}
@@ -10092,11 +10091,10 @@
if (EditingColour != NULL)
{
StatusLine* pStatusLine = GetMainFrame ()->GetpStatusLine ();
- ASSERT (pStatusLine);
if (EditingColour->IsNamed())
{
- if (pStatusLine->IsRestrictedAccessToColourPicker () == FALSE)
+ if (!pStatusLine || (pStatusLine->IsRestrictedAccessToColourPicker () == FALSE))
{
if (AutoModelChangeN)
{
@@ -10281,9 +10279,8 @@
// so we can only edit local line and fill colours.
StatusLine* pStatusLine = GetMainFrame ()->GetpStatusLine ();
- ASSERT (pStatusLine);
- if (pStatusLine->IsRestrictedAccessToColourPicker () == FALSE)
+ if (!pStatusLine || (pStatusLine->IsRestrictedAccessToColourPicker () == FALSE))
{
// Get the current line/fill colours, and see if they match the colour we were asked for
DocColour DocColourToCheck;
Index: Trunk/XaraLX/Kernel/exprview.cpp
===================================================================
--- Trunk/XaraLX/Kernel/exprview.cpp (revision 969)
+++ Trunk/XaraLX/Kernel/exprview.cpp (revision 970)
@@ -634,7 +634,8 @@
{
#ifndef RALPH
// Start the rendering indicator going.
- GetApplication()->GetpStatusLine()->SetRenderIndicator(Rendering);
+ if (GetApplication()->GetpStatusLine())
+ GetApplication()->GetpStatusLine()->SetRenderIndicator(Rendering);
#endif
// Render it.
Error::RenderThreadIn(); // Make errors close window
@@ -643,7 +644,8 @@
#ifndef RALPH
// Disable rendering indicator.
- GetApplication()->GetpStatusLine()->SetRenderIndicator(NotRendering);
+ if (GetApplication()->GetpStatusLine())
+ GetApplication()->GetpStatusLine()->SetRenderIndicator(NotRendering);
#endif
bSuccessful = TRUE;
}
Index: Trunk/XaraLX/Kernel/bmapprev.cpp
===================================================================
--- Trunk/XaraLX/Kernel/bmapprev.cpp (revision 969)
+++ Trunk/XaraLX/Kernel/bmapprev.cpp (revision 970)
@@ -997,8 +997,6 @@
String_256 strStatus(statusTextID);
pStatusLine->UpdateText( &strStatus, FALSE );
}
- else
- ERROR3("pStatusLine == NULL");
}
Index: Trunk/XaraLX/Kernel/rgnlist.cpp
===================================================================
--- Trunk/XaraLX/Kernel/rgnlist.cpp (revision 969)
+++ Trunk/XaraLX/Kernel/rgnlist.cpp (revision 970)
@@ -1107,7 +1107,8 @@
// TRACEUSER("Gerry", _T("BackgroundRender
"));
// Show the user we are rendering.
//GAT
-// GetApplication()->GetpStatusLine()->SetRenderIndicator(Animate);
+// if (GetApplication()->GetpStatusLine())
+// GetApplication()->GetpStatusLine()->SetRenderIndicator(Animate);
GetApplication()->BgRendering = TRUE;
// Do the render.
@@ -1118,7 +1119,8 @@
// Turn off render indicator if needed.
if (GetCount() ==0)
{
-//GAT GetApplication()->GetpStatusLine()->SetRenderIndicator(NotRendering);
+//GAT if (GetApplication()->GetpStatusLine())
+// GetApplication()->GetpStatusLine()->SetRenderIndicator(NotRendering);
GetApplication()->BgRendering = FALSE;
}
@@ -1195,7 +1197,8 @@
// Start the rendering indicator going.
PORTNOTE(Other, "RenderRegionList::ImmediateRender - removed render indicator code" );
#ifndef EXCLUDE_FROM_XARALX
- GetApplication()->GetpStatusLine()->SetRenderIndicator(Rendering);
+ if (GetApplication()->GetpStatusLine())
+ GetApplication()->GetpStatusLine()->SetRenderIndicator(Rendering);
#endif
while (pRegion != NULL)
@@ -1213,7 +1216,8 @@
if ( !pView->GetForeBackMode() || bForceImmediate )
{
// Keep user up to date
-//GAT GetApplication()->GetpStatusLine()->SetRenderIndicator(Animate);
+//GAT if (GetApplication()->GetpStatusLine())
+//GAT GetApplication()->GetpStatusLine()->SetRenderIndicator(Animate);
//TRACE( _T("Immediate Render now
"));
// Render it.
@@ -1229,7 +1233,8 @@
// Disable rendering indicator.
//GAT
-// GetApplication()->GetpStatusLine()->SetRenderIndicator(NotRendering);
+// if (GetApplication()->GetpStatusLine())
+// GetApplication()->GetpStatusLine()->SetRenderIndicator(NotRendering);
}
Index: Trunk/XaraLX/Kernel/guides.cpp
===================================================================
--- Trunk/XaraLX/Kernel/guides.cpp (revision 969)
+++ Trunk/XaraLX/Kernel/guides.cpp (revision 970)
@@ -1631,8 +1631,6 @@
StatusLine* pStatusLine=GetApplication()->GetpStatusLine();
if (pStatusLine!=NULL)
pStatusLine->UpdateText(&Str,STATUSLINE_SELDESC_STATBAR);
- else
- ERROR3("OpGuideline::UpdateStatusLineAndPointer() - pStatusLine==NULL");
}
}
@@ -2947,9 +2945,7 @@
String_256 temp(_R(IDS_OPSPREADORIGINDRAG));
pStatusLine->UpdateText(&temp,STATUSLINE_SELDESC_STATBAR);
}
- else
- ERROR3("OpSpreadOrigin::DoDrag() - pStatusLine==NULL");
-
+
// Tell the Dragging system that we need drags to happen
StartDrag( DRAGTYPE_DEFERSCROLL );
}
Index: Trunk/XaraLX/Kernel/statline.h
===================================================================
--- Trunk/XaraLX/Kernel/statline.h (revision 969)
+++ Trunk/XaraLX/Kernel/statline.h (revision 970)
@@ -105,6 +105,7 @@
#include "flags.h"
#include "camframe.h"
#include "monotime.h"
+#include "stdbars.h"
//#include "ed.h"
class Spread;
@@ -132,7 +133,7 @@
Purpose: Encapsulate the status line
********************************************************************************************/
-class StatusLine : public MessageHandler
+class StatusLine : public StandardBar
{
public:
PORTNOTE("StatusLine", "Removed use of CCStatusBar")
@@ -204,8 +205,12 @@
static BOOL restrictStatusLineFunctionsToColourPicker;
static BOOL DoControlHelp; // whether controls are allowed
// to display help text (or not)
+ static StatusLine * s_pStatusLine;
- CC_DECLARE_MEMDUMP(StatusLine);
+public:
+ static StatusLine * Get() {return s_pStatusLine;}
+
+ CC_DECLARE_DYNCREATE(StatusLine);
};
#endif // INC_STATUSLINE
Index: Trunk/XaraLX/Kernel/statline.cpp
===================================================================
--- Trunk/XaraLX/Kernel/statline.cpp (revision 969)
+++ Trunk/XaraLX/Kernel/statline.cpp (revision 970)
@@ -131,7 +131,7 @@
DECLARE_SOURCE("$Revision$");
-CC_IMPLEMENT_MEMDUMP(StatusLine, MessageHandler);
+CC_IMPLEMENT_DYNCREATE(StatusLine, StandardBar);
#define new CAM_DEBUG_NEW
@@ -146,8 +146,8 @@
String_256 StatusLine::m_strPrefix(_T(""));
BOOL StatusLine::restrictStatusLineFunctionsToColourPicker = FALSE;
BOOL StatusLine::DoControlHelp = TRUE;
+StatusLine * StatusLine::s_pStatusLine = NULL;
-
/*****************************************************************************
> StatusLine::StatusLine()
@@ -176,6 +176,7 @@
// create a 'snapped' mouse pointer
pSnappedCursor = new Cursor(_R(IDCSR_SNAPPED));
SnappedCursorID = 0;
+
}
#else
@@ -214,6 +215,12 @@
delete pSnappedCursor;
pSnappedCursor=NULL;
}
+ if (this == s_pStatusLine)
+ {
+ // Only zap it out if there is a live status line. Status line objects
+ // are temporarily created when invoking bar closure
+ s_pStatusLine = NULL;
+ }
}
@@ -998,6 +1005,31 @@
{
// FixFPControlRegister();
ERROR2IF( pMsg==NULL,FAIL,"StatusLine::Message() - pMsg==NULL");
+
+ if (IS_OUR_DIALOG_MSG(pMsg))
+ {
+ DialogMsg* Msg = (DialogMsg*)pMsg;
+
+ switch(Msg->DlgMsg)
+ {
+ case DIM_CREATE:
+ {
+ if (s_pStatusLine)
+ {
+ ERROR3("Two status lines - that isn't meant to happen");
+ delete s_pStatusLine;
+ }
+ s_pStatusLine = this;
+ }
+
+ default:
+ break;
+
+ }
+ // Else fall through
+ }
+
+
PORTNOTE("StatusLine", "Removed use of CCStatusBar")
#ifndef EXCLUDE_FROM_XARALX
ERROR2IF(pCCStatusBar==NULL,FAIL,"StatusLine::Message() - pCCStatusBar==NULL");
@@ -1078,7 +1110,7 @@
}
#endif
- return OK;
+ return StandardBar::Message(pMsg);
}
Index: Trunk/XaraLX/Kernel/stdbars.cpp
===================================================================
--- Trunk/XaraLX/Kernel/stdbars.cpp (revision 969)
+++ Trunk/XaraLX/Kernel/stdbars.cpp (revision 970)
@@ -97,12 +97,13 @@
*/
#include "camtypes.h"
-#include "ops.h"
-#include "camelot.h"
DECLARE_SOURCE("$Revision$");
#include "stdbars.h"
+#include "statline.h"
+#include "ops.h"
+#include "camelot.h"
CC_IMPLEMENT_DYNCREATE(StandardBar, DialogOp)
@@ -291,13 +292,13 @@
// Note we can't use the "String for only one copy" feature because we allow multiple instances
// of this class, provided they are all for different bars (sigh).
-#define RegisterStandardBarOpDescriptor(name) \
+#define RegisterStandardBarOpDescriptor(class, name) \
(RegisterOpDescriptor( \
0, \
_R(IDS_BUTTBAR_M_ ## name ), /*NORESOURCEFIX*/ \
- CC_RUNTIME_CLASS(StandardBar), \
+ CC_RUNTIME_CLASS(class), \
_T("IDD_BUTTBAR_") _T(#name), /* Use Dialog ID as Optoken */ /*NORESOURCEFIX*/ \
- StandardBar::GetState, /* GetState */ \
+ class::GetState, /* GetState */ \
0, /* help ID */ \
_R(IDBBL_BAR_ ## name), /* Bubble help */ /*NORESOURCEFIX*/ \
0, /* Resource ID */ \
@@ -314,17 +315,18 @@
))
return (
- RegisterStandardBarOpDescriptor(GENERAL) &&
- RegisterStandardBarOpDescriptor(IMAGESETTING) &&
- RegisterStandardBarOpDescriptor(WINDOW) &&
- RegisterStandardBarOpDescriptor(ARRANGE) &&
- RegisterStandardBarOpDescriptor(EDIT) &&
- RegisterStandardBarOpDescriptor(FILE) &&
- RegisterStandardBarOpDescriptor(GALLERIES) &&
- RegisterStandardBarOpDescriptor(STANDARD) &&
- RegisterStandardBarOpDescriptor(TOOLBAR) &&
- RegisterStandardBarOpDescriptor(ANIMATION) &&
- RegisterStandardBarOpDescriptor(FEATHER) &&
+ RegisterStandardBarOpDescriptor(StandardBar, GENERAL) &&
+ RegisterStandardBarOpDescriptor(StandardBar, IMAGESETTING) &&
+ RegisterStandardBarOpDescriptor(StandardBar, WINDOW) &&
+ RegisterStandardBarOpDescriptor(StandardBar, ARRANGE) &&
+ RegisterStandardBarOpDescriptor(StandardBar, EDIT) &&
+ RegisterStandardBarOpDescriptor(StandardBar, FILE) &&
+ RegisterStandardBarOpDescriptor(StandardBar, GALLERIES) &&
+ RegisterStandardBarOpDescriptor(StandardBar, STANDARD) &&
+ RegisterStandardBarOpDescriptor(StandardBar, TOOLBAR) &&
+ RegisterStandardBarOpDescriptor(StandardBar, ANIMATION) &&
+ RegisterStandardBarOpDescriptor(StandardBar, FEATHER) &&
+ RegisterStandardBarOpDescriptor(StatusLine, STATUS) &&
TRUE);
}
Index: Trunk/XaraLX/Kernel/stdbars.h
===================================================================
--- Trunk/XaraLX/Kernel/stdbars.h (revision 969)
+++ Trunk/XaraLX/Kernel/stdbars.h (revision 970)
@@ -110,7 +110,7 @@
*/
#ifndef INC_STDBARS
-#define INC_STBARS
+#define INC_STDBARS
#include "undoop.h"
#include "opdesc.h"
Index: Trunk/XaraLX/Kernel/dialogop.cpp
===================================================================
--- Trunk/XaraLX/Kernel/dialogop.cpp (revision 969)
+++ Trunk/XaraLX/Kernel/dialogop.cpp (revision 970)
@@ -2116,7 +2116,26 @@
DialogManager::SetGadgetBitmaps(GetReadWriteWindowID(), GadgetID, imagelist);
}
+/********************************************************************************************
+> void DialogOp::SetGadgetBitmap(CGadgetID Gadget, ResourceID Bitmap)
+
+ Author: Alex Bligh <alex@xxxxxxxxxxx>
+ Created: 07/05/2006
+ Inputs: GadgetID - The gadget to set the bitmaps of
+ Bitmap - The ID of the bitmap
+ Purpose: Calls the dialog manager to set the bitmaps of the gadget
+
+********************************************************************************************/
+
+void DialogOp::SetGadgetBitmap(CGadgetID Gadget, ResourceID Bitmap)
+{
+ // Call the dialog Manager
+ DialogManager::SetGadgetBitmap(GetReadWriteWindowID(), Gadget, Bitmap);
+}
+
+
+
/********************************************************************************************
> UINT32 DialogOp::GetGadgetImageCount(CGadgetID GadgetID)
Index: Trunk/XaraLX/Kernel/bmpexprw.cpp
===================================================================
--- Trunk/XaraLX/Kernel/bmpexprw.cpp (revision 969)
+++ Trunk/XaraLX/Kernel/bmpexprw.cpp (revision 970)
@@ -574,9 +574,6 @@
StatusLine* pStatusLine=GetApplication()->GetpStatusLine();
if (pStatusLine != NULL)
pStatusLine->UpdateText(&String_256(StatusTextID),FALSE);
- else
- ERROR3("pStatusLine==NULL");
-
}
}
@@ -1061,8 +1058,6 @@
if (StatusTextID != 0)
pStatusLine->UpdateText(&String_256(StatusTextID),FALSE);
}
- else
- ERROR3("pStatusLine==NULL");
// perform the drag operation
if (m_CurrentTool == PREVIEW_PUSH_TOOL)
Index: Trunk/XaraLX/Kernel/snap.cpp
===================================================================
--- Trunk/XaraLX/Kernel/snap.cpp (revision 969)
+++ Trunk/XaraLX/Kernel/snap.cpp (revision 970)
@@ -240,7 +240,6 @@
#if !defined(EXCLUDE_FROM_RALPH)
// update mouse position in StatusLine (with snapped mouse position)
StatusLine* pStatusLine=GetApplication()->GetpStatusLine();
- ERROR3IF(pStatusLine==NULL,"CSnap::Snap() - GetpStatusLine() returned NULL!");
if (pStatusLine)
pStatusLine->UpdateMousePosAndSnap(pDocCoord,pSpread,pDocView,NonGridSnapped);
#endif
Index: Trunk/XaraLX/Kernel/dialogop.h
===================================================================
--- Trunk/XaraLX/Kernel/dialogop.h (revision 969)
+++ Trunk/XaraLX/Kernel/dialogop.h (revision 970)
@@ -433,6 +433,7 @@
// Method to set the bitmaps for a bitmap slider
void SetGadgetBitmaps(CGadgetID GadgetID, UINT32 Bitmap1, UINT32 Bitmap2);
void SetGadgetBitmaps(CGadgetID GadgetID, const CGadgetImageList& imagelist);
+ void SetGadgetBitmap(CGadgetID Gadget, ResourceID Bitmap);
UINT32 GetGadgetImageCount(CGadgetID);
// DY 23/9/99 allows you to specify indexes within a bitmap strip
Index: Trunk/XaraLX/wxOil/scrvw.cpp
===================================================================
--- Trunk/XaraLX/wxOil/scrvw.cpp (revision 969)
+++ Trunk/XaraLX/wxOil/scrvw.cpp (revision 970)
@@ -3526,7 +3526,6 @@
#ifndef RALPH
pStatusLine=GetApplication()->GetpStatusLine();
- ERROR3IF(pStatusLine==NULL,"ScreenView::OnMouseMove() - GetpStatusLine() returned NULL!");
if (pStatusLine)
pStatusLine->FlagMousePosNeedsUpdating();
#endif
Index: Trunk/XaraLX/wxOil/ccolbar.cpp
===================================================================
--- Trunk/XaraLX/wxOil/ccolbar.cpp (revision 969)
+++ Trunk/XaraLX/wxOil/ccolbar.cpp (revision 970)
@@ -5139,8 +5139,6 @@
StatusLine *pStatusLine = GetApplication()->GetpStatusLine();
if (pStatusLine)
pStatusLine->UpdateText(&HelpText, STATUSLINE_SELDESC_COLBAR);
- else
- TRACE(_T("CColourBar::OnMouseMove() - pStatusLine==NULL"));
// TRACEUSER("Gerry", _T("CColourBar updating status to '%s'"), (LPCTSTR)HelpText);
}
Index: Trunk/XaraLX/wxOil/ctrlhelp.cpp
===================================================================
--- Trunk/XaraLX/wxOil/ctrlhelp.cpp (revision 969)
+++ Trunk/XaraLX/wxOil/ctrlhelp.cpp (revision 970)
@@ -1190,8 +1190,6 @@
{
if (pStatusLine)
pStatusLine->UpdateText(&Desc,STATUSLINE_SELDESC_BUTTONS);
- else
- ERROR3("ControlHelper::MyWndProc() - GetpStatusLine() failed");
}
}
}
Index: Trunk/XaraLX/wxOil/cstatbar.cpp
===================================================================
--- Trunk/XaraLX/wxOil/cstatbar.cpp (revision 969)
+++ Trunk/XaraLX/wxOil/cstatbar.cpp (revision 970)
@@ -380,7 +380,6 @@
if (this!=NULL)
{
StatusLine* pStatusLine=GetApplication()->GetpStatusLine();
- ERROR3IF(pStatusLine==NULL,"CCStatusBar::OnMouseMove() - pStatusLine==NULL");
if (pStatusLine)
{
INT32 PaneIndex=GetPaneIndexFromPoint(point);
@@ -600,7 +599,6 @@
ControlHelper::DoBubbleHelpOn(GetSafeHwnd(),PaneIndex,BubbleHelpCallBack,this);
StatusLine* pStatusLine=GetApplication()->GetpStatusLine();
- ERROR3IF(pStatusLine==NULL,"CCStatusBar::OnMouseMove() - pStatusLine==NULL");
if (pStatusLine)
{
String_256 Text("");
Index: Trunk/XaraLX/wxOil/camview.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camview.cpp (revision 969)
+++ Trunk/XaraLX/wxOil/camview.cpp (revision 970)
@@ -2344,7 +2344,6 @@
#ifndef RALPH
pStatusLine=GetApplication()->GetpStatusLine();
- ERROR3IF(pStatusLine==NULL,"ScreenView::OnMouseMove() - GetpStatusLine() returned NULL!");
if (pStatusLine)
pStatusLine->FlagMousePosNeedsUpdating();
#endif
Index: Trunk/XaraLX/wxOil/camelot.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camelot.cpp (revision 969)
+++ Trunk/XaraLX/wxOil/camelot.cpp (revision 970)
@@ -887,6 +887,7 @@
//#endif
+ other_menu->Append( _R(IDD_BUTTBAR_STATUS), _T("Status Bar" " Hmmm"), wxT(""),wxITEM_CHECK );
other_menu->Append( _R(IDD_BUTTBAR_GENERAL), _T("General Bar" " Hmmm"), wxT(""),wxITEM_CHECK );
other_menu->Append( _R(IDD_BUTTBAR_IMAGESETTING), _T("ImageSetting Bar" " Hmmm"), wxT(""),wxITEM_CHECK );
other_menu->Append( _R(IDD_BUTTBAR_WINDOW), _T("Window Bar" " Hmmm"), wxT(""),wxITEM_CHECK );
Index: Trunk/XaraLX/wxOil/cartctl.h
===================================================================
--- Trunk/XaraLX/wxOil/cartctl.h (revision 969)
+++ Trunk/XaraLX/wxOil/cartctl.h (revision 970)
@@ -193,6 +193,7 @@
m_ARDelay=500;
m_ARRepeat=50;
m_AREventPending=FALSE;
+ m_BitmapId=0;
}
// Constructors
@@ -243,7 +244,10 @@
}
wxString GetOpDesc() {return m_OpDesc;}
-
+
+ const ResourceID GetBitmapId() {return m_BitmapId?m_BitmapId:GetId();}
+ void SetBitmapId(ResourceID r=0) {m_BitmapId=r; NewBitmap();}
+
protected:
wxCamArtControlStyle m_CamArtControlStyle;
UINT32 m_Value;
@@ -262,6 +266,8 @@
void FindBitmap();
CamArtFlags GetArtFlags() {return (CamArtFlags)(m_CamArtControlStyle | m_State | (IsEnabled()?0:CAF_GREYED));}
+ ResourceID m_BitmapId;
+
};
/*******************************************************************************************
Index: Trunk/XaraLX/wxOil/dlgmgr.h
===================================================================
--- Trunk/XaraLX/wxOil/dlgmgr.h (revision 969)
+++ Trunk/XaraLX/wxOil/dlgmgr.h (revision 970)
@@ -643,7 +643,8 @@
// Methods to allow you to set the bitmaps associated with a control
static void SetGadgetBitmaps(CWindowID DialogWnd, CGadgetID Gadget, UINT32 Bitmap1, UINT32 Bitmap2);
static void SetGadgetBitmaps(CWindowID DialogWnd, CGadgetID Gadget, const CGadgetImageList& images);
-
+ static void SetGadgetBitmap(CWindowID WindowID, CGadgetID Gadget, ResourceID Bitmap);
+
/* specific to the cc_BitmapButton control, allows you to specify both
selected and unselected bitmaps */
static void SetBitmapButtonIndexes(CWindowID WindowID, CGadgetID Gadget,
Index: Trunk/XaraLX/wxOil/cartctl.cpp
===================================================================
--- Trunk/XaraLX/wxOil/cartctl.cpp (revision 969)
+++ Trunk/XaraLX/wxOil/cartctl.cpp (revision 970)
@@ -222,7 +222,7 @@
void wxCamArtControl::FindBitmap()
{
- m_BestSize=(CamArtProvider::Get())->GetSize((ResourceID)GetId(), GetArtFlags(), GetLabel());
+ m_BestSize=(CamArtProvider::Get())->GetSize(GetBitmapId(), GetArtFlags(), GetLabel());
return;
}
@@ -247,7 +247,7 @@
wxPaintDC dc(this);
wxRect rect = GetClientRect();
- CamArtProvider::Get()->Draw(dc, rect, GetId(), GetArtFlags(), GetLabel());
+ CamArtProvider::Get()->Draw(dc, rect, GetBitmapId(), GetArtFlags(), GetLabel());
}
@@ -439,7 +439,7 @@
wxCommandEvent ButtonEvent(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
ProcessEvent(ButtonEvent);
// If it's attached to an OpDescriptor, we invoke it.
-// ControlList::Get()->Invoke(this);
+// ControlList::/*Get*/()->Invoke(this);
}
/********************************************************************************************
Index: Trunk/XaraLX/wxOil/xrc/EN/statusbar.xrc
===================================================================
--- Trunk/XaraLX/wxOil/xrc/EN/statusbar.xrc (revision 0)
+++ Trunk/XaraLX/wxOil/xrc/EN/statusbar.xrc (revision 970)
@@ -0,0 +1,95 @@
+<?xml version="1.0" ?>
+<resource>
+ <object class="wxPanel" name="IDD_BUTTBAR_STATUS">
+ <label>Status Bar</label>
+ <title>Status Bar</title>
+ <tooltip>Status Bar</tooltip>
+ <help>Status Bar</help>
+ <object class="wxBoxSizer">
+ <orient>wxHORIZONTAL</orient>
+
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE</flag>
+ <border>1</border>
+ <option>1</option>
+ <object class="wxStaticText" name="IDC_STATUSTEXT">
+ <font>
+ <size>8</size>
+ </font>
+ <style>wxALIGN_LEFT</style>
+ <label>Nothing selected</label>
+ <tooltip>Status bar text</tooltip>
+ <help>Displays the current status</help>
+ </object>
+ </object>
+
+ <object class="spacer">
+ <flag>wxALIGN_CENTER_VERTICAL|wxALL</flag>
+ <border>1</border>
+ <size>3,16</size>
+ </object>
+
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL|wxALL</flag>
+ <border>1</border>
+ <object class="wxGauge" name="IDC_PROGRESSGAUGE">
+ <size>-1,12</size>
+ <value>50</value>
+ <range>100</range>
+ </object>
+ </object>
+
+ <object class="spacer">
+ <flag>wxALIGN_CENTER_VERTICAL|wxALL</flag>
+ <border>1</border>
+ <size>3,16</size>
+ </object>
+
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL|wxALL</flag>
+ <border>1</border>
+ <object class="wxCamArtControl" name="IDB_SL_SDRAG0">
+ <camartstyle>wxCACS_PUSHBUTTON|wxCACS_ALLOWHOVER|wxCACS_TOGGLEBUTTON</camartstyle>
+ <optoken>LiveDrag</optoken>
+ </object>
+ </object>
+
+ <object class="spacer">
+ <flag>wxALIGN_CENTER_VERTICAL|wxALL</flag>
+ <border>1</border>
+ <size>3,16</size>
+ </object>
+
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL|wxALL</flag>
+ <border>1</border>
+ <object class="wxCamArtControl" name="IDB_SL_SNAP">
+ <camartstyle></camartstyle>
+ <optoken>SnapIndicator</optoken>
+ </object>
+ </object>
+
+ <object class="spacer">
+ <flag>wxALIGN_CENTER_VERTICAL|wxALL</flag>
+ <border>1</border>
+ <size>3,16</size>
+ </object>
+
+ <object class="sizeritem">
+ <flag>wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE</flag>
+ <border>1</border>
+ <object class="wxStaticText" name="IDC_SL_MOUSEPOSITION">
+ <font>
+ <size>8</size>
+ </font>
+ <size>100,-1</size>
+ <style>wxALIGN_LEFT</style>
+ <label> </label>
+ <tooltip>Mouse position</tooltip>
+ <help>Displays the current mouse position</help>
+ </object>
+ </object>
+
+ </object>
+ </object>
+</resource>
Index: Trunk/XaraLX/wxOil/xrc/EN/xaralxonly-strings.xrc
===================================================================
--- Trunk/XaraLX/wxOil/xrc/EN/xaralxonly-strings.xrc (revision 969)
+++ Trunk/XaraLX/wxOil/xrc/EN/xaralxonly-strings.xrc (revision 970)
@@ -199,6 +199,12 @@
</object>
<object class="sizeritem">
<flag>wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE</flag>
+ <object class="wxStaticText" name="IDS_BAR_STATUS_ONE">
+ <label>That bar is already open</label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE</flag>
<object class="wxStaticText" name="IDS_ANONYMOUSBARTITLE">
<label>Anonymous toolbar or gallery</label>
</object>
@@ -229,6 +235,12 @@
</object>
<object class="sizeritem">
<flag>wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE</flag>
+ <object class="wxStaticText" name="IDS_BUTTBAR_M_STATUS">
+ <label>&Status bar;Toggle status bar</label>
+ </object>
+ </object>
+ <object class="sizeritem">
+ <flag>wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE</flag>
<object class="wxStaticText" name="IDS_BUTTBAR_M_ARRANGE">
<label>&Arrange bar;Toggle arrange bar</label>
</object>
Index: Trunk/XaraLX/wxOil/xrc/SHARED_MENU.res
===================================================================
--- Trunk/XaraLX/wxOil/xrc/SHARED_MENU.res (revision 969)
+++ Trunk/XaraLX/wxOil/xrc/SHARED_MENU.res (revision 970)
@@ -128,6 +128,7 @@
MENUITEM "WindowArrange" SEPARATOR
MENUITEM "ToolbarDlg"
SUBMENU "BarsMenu" SEPARATOR
+ MENUITEM "IDD_BUTTBAR_STATUS"
MENUITEM "IDD_BUTTBAR_GENERAL"
MENUITEM "IDD_BUTTBAR_IMAGESETTING"
MENUITEM "IDD_BUTTBAR_WINDOW"
Index: Trunk/XaraLX/wxOil/dlgmgr.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dlgmgr.cpp (revision 969)
+++ Trunk/XaraLX/wxOil/dlgmgr.cpp (revision 970)
@@ -145,6 +145,7 @@
#include "cartctl.h"
#include "osrndrgn.h"
#include "dlgtypes.h"
+#include "statline.h"
DECLARE_SOURCE("$Revision$");
@@ -339,21 +340,26 @@
// of stuff to be specified. Or try and retrieve it from the DialogBarOp or similar. Anyway, for now
// give it some default parameters
wxPaneInfo paneinfo;
+ paneinfo.DestroyOnClose(FALSE);
if (DlgOp->IsABar())
- {
- paneinfo.ToolbarPane().Fixed().DestroyOnClose(FALSE);
- if (DlgOp->IsVertical())
+ {
+ if (DlgOp->IsKindOf(CC_RUNTIME_CLASS(StatusLine)))
+ paneinfo.Bottom().Layer(1).Row(2).LeftDockable(FALSE).RightDockable(FALSE).Floatable(FALSE).Movable(FALSE).Gripper(FALSE).CaptionVisible(FALSE).PaneBorder(FALSE);
+ else
{
- paneinfo.Left().Layer(0).GripperTop().TopDockable(FALSE).BottomDockable(FALSE);
+ paneinfo.ToolbarPane().Fixed();
+ if (DlgOp->IsVertical())
+ {
+ paneinfo.Left().Layer(0).GripperTop().TopDockable(FALSE).BottomDockable(FALSE);
+ }
+ else
+ {
+ paneinfo.Top().Layer(1).Row(2).LeftDockable(FALSE).RightDockable(FALSE);
+ }
}
- else
- {
- paneinfo.Top().Layer(1).Row(2).LeftDockable(FALSE).RightDockable(FALSE);
- }
}
else
{
- paneinfo.DestroyOnClose(FALSE);
paneinfo.Layer(3).GripperTop().TopDockable(FALSE).BottomDockable(FALSE).Float();
}
@@ -1659,7 +1665,35 @@
#endif
}
+/********************************************************************************************
+> void DialogManager::SetGadgetBitmap(CWindowID WindowID, CGadgetID Gadget,
+ ResourceID Bitmap)
+
+ Author: Alex Bligh <alex@xxxxxxxxxxx>
+ Created: 07/05/2006
+ Inputs: WindowID - Dialog box window identifier
+ Gadget - Identifier of the gadget
+ Bitmap - The resourse ID of the bitmap, or 0 for default;
+ Purpose: This function will set the bitmaps associated with a gadget.
+
+ This works only for bitmap buttons
+
+********************************************************************************************/
+
+void DialogManager::SetGadgetBitmap(CWindowID WindowID, CGadgetID Gadget, ResourceID Bitmap)
+{
+ wxWindow* pGadget = GetGadget(WindowID, Gadget);
+ if (!pGadget) return;
+
+ if ( pGadget->IsKindOf(CLASSINFO(wxCamArtControl))
+ )
+ {
+ ((wxCamArtControl *)pGadget)->SetBitmapId(Bitmap);
+ pGadget->Refresh();
+ }
+}
+
/********************************************************************************************
> void DialogManager::SetGadgetBitmaps(CWindowID WindowID, CGadgetID Gadget,
Index: Trunk/XaraLX/wxOil/oilruler.cpp
===================================================================
--- Trunk/XaraLX/wxOil/oilruler.cpp (revision 969)
+++ Trunk/XaraLX/wxOil/oilruler.cpp (revision 970)
@@ -659,8 +659,6 @@
GetStatusLineText(&Text,MousePos,GetSafeHwnd());
pStatusLine->UpdateText(&Text,STATUSLINE_SELDESC_STATBAR);
}
- else
- ERROR3("OILRuler::OnMouseMove() - pStatusLine==NULL");
OldMousePos = MousePos;
}
@@ -1782,8 +1780,6 @@
GetStatusLineText(&Text,MousePos,GetSafeHwnd());
pStatusLine->UpdateText(&Text,STATUSLINE_SELDESC_STATBAR);
}
- else
- ERROR3("OriginGadget::OnMouseMove() - pStatusLine==NULL");
OldMousePos = MousePos;
}
@@ -2156,8 +2152,6 @@
GetStatusLineText(&Text,MousePos,GetSafeHwnd());
pStatusLine->UpdateText(&Text,STATUSLINE_SELDESC_STATBAR);
}
- else
- ERROR3("LegendLabel::OnMouseMove() - pStatusLine==NULL");
OldMousePos = MousePos;
}
Index: Trunk/XaraLX/wxOil/camframe.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camframe.cpp (revision 969)
+++ Trunk/XaraLX/wxOil/camframe.cpp (revision 970)
@@ -202,6 +202,7 @@
EVT_MENU( _R(IDD_BUTTBAR_TOOLBAR), CCamFrame::OnStandardBar )
EVT_MENU( _R(IDD_BUTTBAR_ANIMATION), CCamFrame::OnStandardBar )
EVT_MENU( _R(IDD_BUTTBAR_FEATHER), CCamFrame::OnStandardBar )
+ EVT_MENU( _R(IDD_BUTTBAR_STATUS), CCamFrame::OnStandardBar )
EVT_MENU_OPEN( CCamFrame::OnInitMenuPopup )
@@ -216,6 +217,7 @@
EVT_UPDATE_UI( _R(IDD_BUTTBAR_TOOLBAR), CCamFrame::OnUpdateStandardBar )
EVT_UPDATE_UI( _R(IDD_BUTTBAR_ANIMATION), CCamFrame::OnUpdateStandardBar )
EVT_UPDATE_UI( _R(IDD_BUTTBAR_FEATHER), CCamFrame::OnUpdateStandardBar )
+ EVT_UPDATE_UI( _R(IDD_BUTTBAR_STATUS), CCamFrame::OnUpdateStandardBar )
EVT_UPDATE_UI( _R(DOCVIEW_ZOOMPREVIOUS), CCamFrame::OnUpdateZoomPrevious )
EVT_UPDATE_UI( _R(DOCVIEW_QUALITYOUTLINE), CCamFrame::OnUpdateQualityOutline )
@@ -353,10 +355,12 @@
BOOL CCamFrame::CreateToolbars()
{
+#if 0
// Create the status bar
m_pStatusBar = CreateStatusBar();
String_256 strStatus( _R(IDS_NO_OBJECTS_SEL) );
m_pStatusBar->SetStatusText( strStatus );
+#endif
CColourBar* pColourBar = new CColourBar();
if (pColourBar)
@@ -385,6 +389,9 @@
wxCommandEvent tbe(wxEVT_COMMAND_MENU_SELECTED, _R(IDD_BUTTBAR_TOOLBAR));
OnStandardBar(tbe);
+ wxCommandEvent sbbe(wxEVT_COMMAND_MENU_SELECTED, _R(IDD_BUTTBAR_STATUS));
+ OnStandardBar(sbbe);
+
return TRUE;
}
Xara