[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
[XaraXtreme-commits] Commit Complete
Commit by : alex
Repository : xara
Revision : 989
Date : Wed May 10 09:24:14 BST 2006
Changed paths:
M /Trunk/XaraLX/Kernel/dialogop.cpp
M /Trunk/XaraLX/Kernel/dialogop.h
M /Trunk/XaraLX/Kernel/statline.cpp
M /Trunk/XaraLX/wxOil/dlgevt.cpp
M /Trunk/XaraLX/wxOil/dlgevt.h
M /Trunk/XaraLX/wxOil/dlgmgr.cpp
M /Trunk/XaraLX/wxOil/dlgmgr.h
M /Trunk/XaraLX/wxOil/dlgtypes.h
M /Trunk/XaraLX/wxOil/xrc/EN/statusbar.xrc
More progress and status work
Diff:
Index: Trunk/XaraLX/Kernel/statline.cpp
===================================================================
--- Trunk/XaraLX/Kernel/statline.cpp (revision 988)
+++ Trunk/XaraLX/Kernel/statline.cpp (revision 989)
@@ -965,8 +965,21 @@
}
s_pStatusLine = this;
SetGadgetBitmap(_R(IDB_SL_SNAP), _R(IDB_SL_SNAPN)); // turn snap off by default
+ nobreak; // FALL THROUGH!
}
-
+ case DIM_DLG_RESIZED:
+ {
+ if (!ProgressShown)
+ {
+ // For some reason we need to do a relayout with the gadgets shown
+ HideGadget(_R(IDC_SL_PROGRESSGAUGE), FALSE);
+ HideGadget(_R(IDC_SL_PROGRESSPERCENT), FALSE);
+ Layout();
+ HideGadget(_R(IDC_SL_PROGRESSGAUGE), !ProgressShown);
+ HideGadget(_R(IDC_SL_PROGRESSPERCENT), !ProgressShown);
+ }
+ break;
+ }
default:
break;
@@ -1298,7 +1311,7 @@
{
HideGadget(_R(IDC_SL_PROGRESSGAUGE), !Show);
HideGadget(_R(IDC_SL_PROGRESSPERCENT), !Show);
-
+ Layout();
ProgressShown=Show;
CurrentPercent=-1; // Force a redraw
Index: Trunk/XaraLX/Kernel/dialogop.cpp
===================================================================
--- Trunk/XaraLX/Kernel/dialogop.cpp (revision 988)
+++ Trunk/XaraLX/Kernel/dialogop.cpp (revision 989)
@@ -1814,6 +1814,26 @@
{
return (DlgMgr->HideGadget(GetReadWriteWindowID(), GadgetID, Hide));
}
+
+/********************************************************************************************
+
+> void DialogOp::Layout(BOOL CanYield = FALSE)
+
+ Author: Alex Bligh <alex@xxxxxxxxxxx>
+ Created: 10/05/2006
+ Inputs: -
+ Outputs: -
+ Returns: -
+ Purpose: Relayout dialog - for sizer changes
+ Errors: -
+ SeeAlso: -
+
+********************************************************************************************/
+
+void DialogOp::Layout(BOOL CanYield /*=FALSE*/)
+{
+ DlgMgr->Layout(GetReadWriteWindowID(), CanYield);
+}
/********************************************************************************************
Index: Trunk/XaraLX/Kernel/dialogop.h
===================================================================
--- Trunk/XaraLX/Kernel/dialogop.h (revision 988)
+++ Trunk/XaraLX/Kernel/dialogop.h (revision 989)
@@ -377,6 +377,7 @@
BOOL EnableGadget(CGadgetID GadgetID, BOOL Enabled);
BOOL HideGadget(CGadgetID GadgetID, BOOL Hide);
BOOL GadgetRedraw(CGadgetID GadgetID, BOOL Redraw);
+ void Layout(BOOL CanYield = FALSE);
//--------------------------------------------------------------------------------------
Index: Trunk/XaraLX/wxOil/dlgevt.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dlgevt.cpp (revision 988)
+++ Trunk/XaraLX/wxOil/dlgevt.cpp (revision 989)
@@ -150,6 +150,8 @@
EVT_CAMDIALOG_DEFERREDMSG (wxID_ANY, DialogEventHandler::CamDialogEvent)
EVT_CAMDIALOG_GRIMREAPER (wxID_ANY, DialogEventHandler::GrimReaperEvent)
EVT_CAMDIALOG_REDRAW (wxID_ANY, DialogEventHandler::CamDialogEvent)
+ EVT_MOVE (DialogEventHandler::MoveEvent)
+ EVT_SIZE (DialogEventHandler::SizeEvent)
END_EVENT_TABLE();
DEFINE_EVENT_TYPE(wxEVT_CAMDIALOG_DEFERREDMSG)
@@ -548,6 +550,50 @@
/********************************************************************************************
+> DialogEventHandler::MoveEvent(wxMoveEvent& event)
+
+
+ Author: Alex_Bligh <alex@xxxxxxxxxxx>
+ Created: 02/12/2005
+ Inputs: event - the wxEvent
+ Outputs: -
+ Returns: -
+ Purpose: Passes an event to DialogManager::Event
+ Errors: -
+ SeeAlso: -
+
+********************************************************************************************/
+
+
+void DialogEventHandler::MoveEvent(wxMoveEvent& event)
+{
+ DialogManager::Event(this, event);
+}
+
+/********************************************************************************************
+
+> DialogEventHandler::SizeEvent(wxSizeEvent& event)
+
+
+ Author: Alex_Bligh <alex@xxxxxxxxxxx>
+ Created: 02/12/2005
+ Inputs: event - the wxEvent
+ Outputs: -
+ Returns: -
+ Purpose: Passes an event to DialogManager::Event
+ Errors: -
+ SeeAlso: -
+
+********************************************************************************************/
+
+
+void DialogEventHandler::SizeEvent(wxSizeEvent& event)
+{
+ DialogManager::Event(this, event);
+}
+
+/********************************************************************************************
+
> static inline const TCHAR * DialogEventHandler::GetEventName(WXTYPE eventnum)
Index: Trunk/XaraLX/wxOil/dlgmgr.h
===================================================================
--- Trunk/XaraLX/wxOil/dlgmgr.h (revision 988)
+++ Trunk/XaraLX/wxOil/dlgmgr.h (revision 989)
@@ -592,6 +592,7 @@
static BOOL EnableGadget(CWindowID WindowID, CGadgetID Gadget, BOOL Enabled);
static BOOL HideGadget(CWindowID WindowID, CGadgetID Gadget, BOOL Hide);
static BOOL GadgetRedraw(CWindowID WindowID, CGadgetID Gadget, BOOL Redraw);
+ static void Layout(CWindowID WindowID, BOOL CanYield=FALSE);
// This function should be called after hiding\showing a control,
// so the dialog can be resized
Index: Trunk/XaraLX/wxOil/dlgevt.h
===================================================================
--- Trunk/XaraLX/wxOil/dlgevt.h (revision 988)
+++ Trunk/XaraLX/wxOil/dlgevt.h (revision 989)
@@ -143,6 +143,8 @@
void WindowDestroyEvent(wxWindowDestroyEvent &event);
void OnSetFocus(wxChildFocusEvent &event);
void CamDialogEvent(wxCamDialogEvent &event);
+ void MoveEvent(wxMoveEvent &event);
+ void SizeEvent(wxSizeEvent &event);
void GrimReaperEvent(wxCamDialogEvent &event);
Index: Trunk/XaraLX/wxOil/xrc/EN/statusbar.xrc
===================================================================
--- Trunk/XaraLX/wxOil/xrc/EN/statusbar.xrc (revision 988)
+++ Trunk/XaraLX/wxOil/xrc/EN/statusbar.xrc (revision 989)
@@ -9,13 +9,13 @@
<orient>wxHORIZONTAL</orient>
<object class="sizeritem">
- <flag>wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE|wxGROW</flag>
+ <flag>wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL|wxFIXED_MINSIZE|wxGROW</flag>
<border>1</border>
<option>1</option>
<object class="wxCamArtControl" name="IDC_SL_STATUSTEXT">
- <camartstyle>wxCACS_TEXT|wxCACS_LEFT|wxCACS_EXACTFIT</camartstyle>
+ <camartstyle>wxCACS_TEXT|wxCACS_LEFT|wxCACS_EXACTFIT|wxCACS_STATUSBARTEXT</camartstyle>
<style>wxFULL_REPAINT_ON_RESIZE</style>
- <size>-1,12</size>
+ <size>12,12</size>
<label>Nothing Selected</label>
<tooltip>Status bar text</tooltip>
<help>Displays the current status</help>
@@ -39,15 +39,16 @@
</object>
</object>
<object class="sizeritem">
- <flag>wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE</flag>
+ <flag>wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxALL|wxFIXED_MINSIZE</flag>
<border>1</border>
<object class="wxStaticText" name="IDC_SL_PROGRESSPERCENT">
<hidden>1</hidden>
<font>
<size>8</size>
</font>
- <style>wxALIGN_LEFT</style>
- <label>00% </label>
+ <size>30,13</size>
+ <style>wxALIGN_LEFT|wxST_NO_AUTORESIZE</style>
+ <label>100% </label>
<tooltip>Status bar text</tooltip>
<help>Displays the current status</help>
</object>
Index: Trunk/XaraLX/wxOil/dlgtypes.h
===================================================================
--- Trunk/XaraLX/wxOil/dlgtypes.h (revision 988)
+++ Trunk/XaraLX/wxOil/dlgtypes.h (revision 989)
@@ -216,6 +216,7 @@
DIM_SPINCONTROLDOWN, // Special spin control message
DIM_DLG_MOVED, // the dialog has been moved
+ DIM_DLG_RESIZED, // the dialog has been resized
DIM_COMMIT_BRUSH, // special message sent by the brush dialog
Index: Trunk/XaraLX/wxOil/dlgmgr.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dlgmgr.cpp (revision 988)
+++ Trunk/XaraLX/wxOil/dlgmgr.cpp (revision 989)
@@ -1067,6 +1067,20 @@
HandleMessage = TRUE;
}
else if (
+ (EventType == wxEVT_MOVE) ||
+ FALSE)
+ {
+ msg.DlgMsg = DIM_DLG_MOVED;
+ HandleMessage = TRUE;
+ }
+ else if (
+ (EventType == wxEVT_SIZE) ||
+ FALSE)
+ {
+ msg.DlgMsg = DIM_DLG_RESIZED;
+ HandleMessage = TRUE;
+ }
+ else if (
((EventType == wxEVT_CAMDIALOG_REDRAW) && (pGadget)) ||
FALSE)
{
@@ -4648,6 +4662,32 @@
/********************************************************************************************
+> void DialogManager::Layout(CWindowID WindowID, BOOL CanYield=FALSE)
+
+ Author: Alex Bligh <alex@xxxxxxxxxxx>
+ Created: 10/05/2006
+ Inputs: WindowID: Dialog box window identifier
+ Outputs: -
+ Returns: -
+ Purpose: Relayout dialog - for sizer changes
+ Errors: -
+ SeeAlso: -
+
+********************************************************************************************/
+
+void DialogManager::Layout(CWindowID WindowID, BOOL CanYield /*=FALSE*/)
+{
+ ((wxWindow *)WindowID)->Layout();
+ if (CanYield)
+ {
+ // wxWidgets needs a yield to process these, but we can't always yield
+ wxWindowDisabler(WindowID);
+ wxYieldIfNeeded();
+ }
+}
+
+/********************************************************************************************
+
> BOOL DialogManager::GadgetRedraw(CWindowID WindowID, CGadgetID Gadget, BOOL Redraw)
Author: Simon_Maneggio (Xara Group Ltd) <camelotdev@xxxxxxxx>
Xara