[BUG_FIXED] Fix color picker' chooser does not work well.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1268 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2014-07-29 13:08:32 +00:00
parent 9418974c87
commit 5d0858d5c7
3 changed files with 11 additions and 5 deletions

View File

@ -130,6 +130,7 @@ LRESULT ColourPicker::runProc(UINT Message, WPARAM wParam, LPARAM lParam)
}
else
{
_pColourPopup->setColour(_currentColour);
_pColourPopup->doDialog(p);
_pColourPopup->display(true);
}

View File

@ -181,7 +181,7 @@ BOOL CALLBACK ColourPopup::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara
{
case IDOK :
{
isColourChooserLaunched = true;
//isColourChooserLaunched = true;
CHOOSECOLOR cc; // common dialog box structure
static COLORREF acrCustClr[16] = {
RGB(0xFF,0xFF,0xFF),RGB(0xFF,0xFF,0xFF),RGB(0xFF,0xFF,0xFF),RGB(0xFF,0xFF,0xFF),\
@ -232,7 +232,7 @@ BOOL CALLBACK ColourPopup::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara
case WM_ACTIVATE :
{
if (LOWORD(wParam) == WA_INACTIVE)
if (!isColourChooserLaunched)
//if (!isColourChooserLaunched)
::SendMessage(_hParent, WM_PICKUP_CANCEL, 0, 0);
return TRUE;
}

View File

@ -43,8 +43,8 @@
class ColourPopup : public Window
{
public :
ColourPopup() : Window(), isColourChooserLaunched(false) {};
ColourPopup(COLORREF defaultColor) : Window(), isColourChooserLaunched(false), _colour(defaultColor) {};
ColourPopup() : Window()/*, isColourChooserLaunched(false)*/ {};
ColourPopup(COLORREF defaultColor) : Window(), /* isColourChooserLaunched(false), */ _colour(defaultColor) {};
~ColourPopup(){};
bool isCreated() const {
@ -62,12 +62,17 @@ public :
virtual void destroy() {
::DestroyWindow(_hSelf);
};
void setColour(COLORREF c) {
_colour = c;
};
COLORREF getSelColour(){return _colour;};
private :
RECT _rc;
COLORREF _colour;
bool isColourChooserLaunched;
//bool isColourChooserLaunched;
static BOOL CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);