[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : luke
Repository : xara
Revision   : 1751
Date       : Wed Sep 13 12:33:16 BST 2006

Changed paths:
   M /Trunk/XaraLX/Kernel/dialogop.cpp
   M /Trunk/XaraLX/Kernel/dialogop.h
   M /Trunk/XaraLX/tools/bevinfo.cpp
   M /Trunk/XaraLX/tools/bevinfo.h
   M /Trunk/XaraLX/wxOil/dlgmgr.cpp
   M /Trunk/XaraLX/wxOil/dlgmgr.h

Remove some code thats the only visible purpose is to break the display of bevel type (See BZ #1233). Also moved some oily code to Dialog Manager


Diff:
Index: Trunk/XaraLX/tools/bevinfo.cpp
===================================================================
--- Trunk/XaraLX/tools/bevinfo.cpp	(revision 1750)
+++ Trunk/XaraLX/tools/bevinfo.cpp	(revision 1751)
@@ -317,9 +317,6 @@
 				UpdateControls();
 				UpdateJoinTypeControls();
 				
-				// set up all the combo's initial states
-				SetBoolGadgetSelected(_R(IDC_BEVEL_TYPE_COMBO), TRUE);
-				
 				SetGadgetBitmaps(_R(IDC_BEVELSLIDER), _R(IDB_SLIDERBASE), _R(IDB_SLIDERSLIDER));
 
 				m_bComboChanged = FALSE;
@@ -1469,39 +1466,7 @@
 
 }
 
-/********************************************************************************************
 
->	void BevelInfoBarOp::SetGadgetWritable(INT32 id, BOOL enable)
-
-	Author:		DMC
-	Created:	15/11/94
-	Inputs:		id, the 'IDC_?' of the control.
-				enable, TRUE to allow the control to be typed into. FALSE to make it
-						read only.
-	Purpose:	Sets the state of the 'Read Only' flag of an edit field or combo box.
-
-********************************************************************************************/
-
-void BevelInfoBarOp::SetGadgetWritable(INT32 id, BOOL enable)
-{
-PORTNOTE("other", "Removed SetGadgetWritable")
-#ifndef EXCLUDE_FROM_XARALX
-	// Get the window handle of the gadget, from the gadget ID
-	HWND gadget = ::GetDlgItem(WindowID, id);
-
-	// See if it's got a child window (it may be a Combo Box)
-	HWND hEdit = ::ChildWindowFromPoint(gadget, CPoint(1,1));
-
-	if (hEdit)				// Was there a child window ?
-		gadget = hEdit;		// Yes, so send the message to it
-
- 	if (enable)
-		::SendMessage(gadget, EM_SETREADONLY, FALSE, 0);	// Clear the Read Only Flag
-	else
-		::SendMessage(gadget, EM_SETREADONLY, TRUE, 0);		// Set the Read Only Flag
-#endif
-}
-
 /********************************************************************************************
 
 >	BOOL SoftShadowInfoBarOp::ConvertValueToString(String_256 &In, const INT32 value, UnitType type, String_256 &unit)
Index: Trunk/XaraLX/tools/bevinfo.h
===================================================================
--- Trunk/XaraLX/tools/bevinfo.h	(revision 1750)
+++ Trunk/XaraLX/tools/bevinfo.h	(revision 1751)
@@ -196,9 +196,6 @@
 	BOOL m_BetweenViews;
 
 private:
-	// same as for filltool
-	void SetGadgetWritable(INT32 id, BOOL enable);
-
 	// conversion functions for the edit box
 	BOOL ConvertValueToString(String_256 &In, const INT32 value, UnitType type=NOTYPE);
 	BOOL ConvertStringToValue(CGadgetID ID,INT32 &value);
Index: Trunk/XaraLX/Kernel/dialogop.cpp
===================================================================
--- Trunk/XaraLX/Kernel/dialogop.cpp	(revision 1750)
+++ Trunk/XaraLX/Kernel/dialogop.cpp	(revision 1751)
@@ -1845,6 +1845,24 @@
 
 /********************************************************************************************
 
+>	void DialogManager::SetGadgetWritable(CWindowID id, BOOL enable)
+
+	Author:		DMC
+	Created:	15/11/94
+	Inputs:		id, the 'IDC_?' of the control.
+				enable, TRUE to allow the control to be typed into. FALSE to make it
+						read only.
+	Purpose:	Sets the state of the 'Read Only' flag of an edit field or combo box.
+
+********************************************************************************************/
+
+BOOL DialogOp::SetGadgetWritable(CGadgetID GadgetID, BOOL enable)
+{
+	return( DlgMgr->SetGadgetWritable( GetReadWriteWindowID(), GadgetID, enable ) );
+}
+
+/********************************************************************************************
+
 >	void DialogOp::Layout(BOOL CanYield = FALSE)
 
 	Author:		Alex Bligh <alex@xxxxxxxxxxx>
Index: Trunk/XaraLX/Kernel/dialogop.h
===================================================================
--- Trunk/XaraLX/Kernel/dialogop.h	(revision 1750)
+++ Trunk/XaraLX/Kernel/dialogop.h	(revision 1751)
@@ -382,6 +382,7 @@
 	BOOL EnableGadget(CGadgetID GadgetID, BOOL Enabled);
 	BOOL IsGadgetEnabled( CGadgetID Gadget );
 	BOOL HideGadget(CGadgetID GadgetID, BOOL Hide);
+	BOOL SetGadgetWritable(CGadgetID Gadget, BOOL enable);
 	BOOL GadgetRedraw(CGadgetID GadgetID, BOOL Redraw);
 	void Layout(BOOL CanYield = FALSE);
 
Index: Trunk/XaraLX/wxOil/dlgmgr.h
===================================================================
--- Trunk/XaraLX/wxOil/dlgmgr.h	(revision 1750)
+++ Trunk/XaraLX/wxOil/dlgmgr.h	(revision 1751)
@@ -593,6 +593,7 @@
     // Functions for changing a gadgets state 
 	static BOOL EnableGadget(CWindowID WindowID, CGadgetID Gadget, BOOL Enabled);
 	static BOOL IsGadgetEnabled( CWindowID WindowID, CGadgetID Gadget );
+	static BOOL SetGadgetWritable(CWindowID id, CGadgetID Gadget, BOOL enable);
 	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);
Index: Trunk/XaraLX/wxOil/dlgmgr.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dlgmgr.cpp	(revision 1750)
+++ Trunk/XaraLX/wxOil/dlgmgr.cpp	(revision 1751)
@@ -5166,6 +5166,50 @@
 
 /********************************************************************************************
 
+>	void DialogManager::SetGadgetWritable(CWindowID id, BOOL enable)
+
+	Author:		DMC
+	Created:	15/11/94
+	Inputs:		id, the 'IDC_?' of the control.
+				enable, TRUE to allow the control to be typed into. FALSE to make it
+						read only.
+	Purpose:	Sets the state of the 'Read Only' flag of an edit field or combo box.
+
+********************************************************************************************/
+
+BOOL DialogManager::SetGadgetWritable(CWindowID WindowID, CGadgetID Gadget, BOOL enable)
+{
+	// Get the window handle of the gadget, from the gadget ID
+	wxWindow*			pGadget = GetGadget( WindowID, Gadget );
+	if( !pGadget )
+		return FALSE;
+
+	if( pGadget->IsKindOf( CLASSINFO(wxTextCtrl) ) )
+		( (wxTextCtrl*)pGadget )->SetEditable( FALSE != enable );
+	else
+	{
+PORTNOTETRACE("other", "Removed SetGadgetWritable handling of on TextCtrl");
+#ifndef EXCLUDE_FROM_XARALX
+		// See if it's got a child window (it may be a Combo Box)
+		HWND hEdit = ::ChildWindowFromPoint(gadget, CPoint(1,1));
+
+		if (hEdit)				// Was there a child window ?
+			gadget = hEdit;		// Yes, so send the message to it
+
+ 		if (enable)
+			::SendMessage(gadget, EM_SETREADONLY, FALSE, 0);	// Clear the Read Only Flag
+		else
+			::SendMessage(gadget, EM_SETREADONLY, TRUE, 0);		// Set the Read Only Flag
+#else
+		return FALSE;
+#endif
+	}
+
+	return TRUE;
+}
+
+/********************************************************************************************
+
 >	BOOL DialogManager::IsGadgetEnabled( CWindowID WindowID, CGadgetID Gadget );
 
 	Author:		Luke_Hart (Xara Group Ltd) <lukeh@xxxxxxxx>


Xara