Browse Source

Fixed issue with not applying color selection in clip editor

git-svn-id: svn://svn.code.sf.net/p/ditto-cp/code/trunk@772 595ec19a-5cb4-439b-94a8-42fb3063c22c
sabrogden 10 years ago
parent
commit
489ba94ba1

+ 8 - 0
RulerRichEditCtrl/External/ColourPicker.cpp

@@ -81,12 +81,20 @@ BEGIN_MESSAGE_MAP(CColourPicker, CButton)
     //{{AFX_MSG_MAP(CColourPicker)
     ON_CONTROL_REFLECT_EX(BN_CLICKED, OnClicked)
     ON_WM_CREATE()
+	ON_MESSAGE(CPN_SELENDOK, OnColorButton)
     //}}AFX_MSG_MAP
     //ON_MESSAGE(CPN_SELENDOK,     OnSelEndOK)
     //ON_MESSAGE(CPN_SELENDCANCEL, OnSelEndCancel)
     //ON_MESSAGE(CPN_SELCHANGE,    OnSelChange)
 END_MESSAGE_MAP()
 
+LRESULT CColourPicker::OnColorButton(WPARAM w, LPARAM l)
+{
+	GetParent()->SendMessage(CPN_SELENDOK, w, (LPARAM)l);
+
+	return 0;
+}
+
 /////////////////////////////////////////////////////////////////////////////
 // CColourPicker message handlers
 

+ 1 - 0
RulerRichEditCtrl/External/ColourPicker.h

@@ -97,6 +97,7 @@ protected:
     //{{AFX_MSG(CColourPicker)
     afx_msg BOOL OnClicked();
     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
+	LRESULT OnColorButton(WPARAM w, LPARAM l);
     //}}AFX_MSG
     /*afx_msg LRESULT OnSelEndOK(LPARAM lParam, WPARAM wParam);
     afx_msg LRESULT OnSelEndCancel(LPARAM lParam, WPARAM wParam);

+ 2 - 6
RulerRichEditCtrl/RRECToolbar.cpp

@@ -307,7 +307,7 @@ void CRRECToolbar::OnSelchangeSize()
 	
 }
 
-LRESULT CRRECToolbar::OnColorButton( WPARAM, LPARAM ) 
+LRESULT CRRECToolbar::OnColorButton( WPARAM w, LPARAM l) 
 /* ============================================================
 	Function :		CRRECToolbar::OnColorButton
 	Description :	Mapped to the color picker defined 
@@ -323,11 +323,7 @@ LRESULT CRRECToolbar::OnColorButton( WPARAM, LPARAM )
 
    ============================================================*/
 {
-
-	COLORREF color = RGB( 0, 0, 0 );
-	color = m_color.GetColour();
-
-	GetParent()->SendMessage( urm_SETCURRENTFONTCOLOR, 0, ( LPARAM ) color );
+	GetParent()->SendMessage( urm_SETCURRENTFONTCOLOR, 0, ( LPARAM ) w );
 	
 	return 0;
 }

+ 1 - 1
RulerRichEditCtrl/RRECToolbar.h

@@ -58,7 +58,7 @@ protected:
 		// NOTE - the ClassWizard will add and remove member functions here.
 	afx_msg void OnSelchangeFont();
 	afx_msg void OnSelchangeSize();
-	afx_msg LRESULT OnColorButton( WPARAM, LPARAM );
+	afx_msg LRESULT OnColorButton( WPARAM w, LPARAM l);
 	//}}AFX_MSG
 
 	DECLARE_MESSAGE_MAP()