forked from mia/Aegisub
Use PersistLocation for DialogColorPicker
Originally committed to SVN as r5521.
This commit is contained in:
parent
833c35f6ae
commit
d3ab35a61f
|
@ -63,6 +63,8 @@
|
||||||
#include <wx/tokenzr.h>
|
#include <wx/tokenzr.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <libaegisub/scoped_ptr.h>
|
||||||
|
|
||||||
#include "ass_style.h"
|
#include "ass_style.h"
|
||||||
#include "colorspace.h"
|
#include "colorspace.h"
|
||||||
#include "compat.h"
|
#include "compat.h"
|
||||||
|
@ -70,6 +72,7 @@
|
||||||
#include "help_button.h"
|
#include "help_button.h"
|
||||||
#include "libresrc/libresrc.h"
|
#include "libresrc/libresrc.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "persist_location.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
/// DOCME
|
/// DOCME
|
||||||
|
@ -213,7 +216,7 @@ DECLARE_EVENT_TYPE(wxDROPPER_SELECT, -1)
|
||||||
///
|
///
|
||||||
/// DOCME
|
/// DOCME
|
||||||
class DialogColorPicker : public wxDialog {
|
class DialogColorPicker : public wxDialog {
|
||||||
private:
|
agi::scoped_ptr<PersistLocation> persist;
|
||||||
|
|
||||||
/// DOCME
|
/// DOCME
|
||||||
wxColour cur_color;
|
wxColour cur_color;
|
||||||
|
@ -234,34 +237,19 @@ private:
|
||||||
wxChoice *colorspace_choice;
|
wxChoice *colorspace_choice;
|
||||||
|
|
||||||
/// DOCME
|
/// DOCME
|
||||||
static const int slider_width = 10; // width in pixels of the color slider control
|
static const int slider_width = 10; ///< width in pixels of the color slider control
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
wxSpinCtrl *rgb_input[3];
|
wxSpinCtrl *rgb_input[3];
|
||||||
|
wxBitmap *rgb_spectrum[3]; ///< x/y spectrum bitmap where color "i" is excluded from
|
||||||
/// DOCME
|
wxBitmap *rgb_slider[3]; ///< z spectrum for color "i"
|
||||||
wxBitmap *rgb_spectrum[3]; // x/y spectrum bitmap where color "i" is excluded from
|
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
wxBitmap *rgb_slider[3]; // z spectrum for color "i"
|
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
wxSpinCtrl *hsl_input[3];
|
wxSpinCtrl *hsl_input[3];
|
||||||
|
wxBitmap *hsl_spectrum; ///< h/s spectrum
|
||||||
/// DOCME
|
wxBitmap *hsl_slider; ///< l spectrum
|
||||||
wxBitmap *hsl_spectrum; // h/s spectrum
|
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
wxBitmap *hsl_slider; // l spectrum
|
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
wxSpinCtrl *hsv_input[3];
|
wxSpinCtrl *hsv_input[3];
|
||||||
|
wxBitmap *hsv_spectrum; ///< s/v spectrum
|
||||||
/// DOCME
|
wxBitmap *hsv_slider; ///< h spectrum
|
||||||
wxBitmap *hsv_spectrum; // s/v spectrum
|
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
wxBitmap *hsv_slider; // h spectrum
|
|
||||||
|
|
||||||
/// DOCME
|
/// DOCME
|
||||||
wxBitmap eyedropper_bitmap;
|
wxBitmap eyedropper_bitmap;
|
||||||
|
@ -272,11 +260,8 @@ private:
|
||||||
/// DOCME
|
/// DOCME
|
||||||
bool eyedropper_is_grabbed;
|
bool eyedropper_is_grabbed;
|
||||||
|
|
||||||
/// DOCME
|
wxTextCtrl *ass_input; ///< ASS hex format input
|
||||||
wxTextCtrl *ass_input; // ASS hex format input
|
wxTextCtrl *html_input; ///< HTML hex format input
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
wxTextCtrl *html_input; // HTML hex format input
|
|
||||||
|
|
||||||
/// DOCME
|
/// DOCME
|
||||||
wxStaticBitmap *preview_box;
|
wxStaticBitmap *preview_box;
|
||||||
|
@ -322,11 +307,6 @@ private:
|
||||||
void OnDropperMouse(wxMouseEvent &evt);
|
void OnDropperMouse(wxMouseEvent &evt);
|
||||||
void OnMouse(wxMouseEvent &evt);
|
void OnMouse(wxMouseEvent &evt);
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
static int lastx, lasty;
|
|
||||||
|
|
||||||
ColorCallback callback;
|
ColorCallback callback;
|
||||||
void *callbackUserdata;
|
void *callbackUserdata;
|
||||||
|
|
||||||
|
@ -341,59 +321,23 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
SELECTOR_SPECTRUM = 4000,
|
SELECTOR_SPECTRUM = 4000,
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
SELECTOR_SLIDER,
|
SELECTOR_SLIDER,
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
SELECTOR_MODE,
|
SELECTOR_MODE,
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
SELECTOR_RGB_R,
|
SELECTOR_RGB_R,
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
SELECTOR_RGB_G,
|
SELECTOR_RGB_G,
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
SELECTOR_RGB_B,
|
SELECTOR_RGB_B,
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
SELECTOR_HSL_H,
|
SELECTOR_HSL_H,
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
SELECTOR_HSL_S,
|
SELECTOR_HSL_S,
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
SELECTOR_HSL_L,
|
SELECTOR_HSL_L,
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
SELECTOR_HSV_H,
|
SELECTOR_HSV_H,
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
SELECTOR_HSV_S,
|
SELECTOR_HSV_S,
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
SELECTOR_HSV_V,
|
SELECTOR_HSV_V,
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
SELECTOR_ASS_INPUT,
|
SELECTOR_ASS_INPUT,
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
SELECTOR_HTML_INPUT,
|
SELECTOR_HTML_INPUT,
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
SELECTOR_RECENT,
|
SELECTOR_RECENT,
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
SELECTOR_DROPPER,
|
SELECTOR_DROPPER,
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
SELECTOR_DROPPER_PICK,
|
SELECTOR_DROPPER_PICK,
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
BUTTON_RGBADJUST
|
BUTTON_RGBADJUST
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1111,13 +1055,6 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, wxColour initial_color, C
|
||||||
SetSizer(main_sizer);
|
SetSizer(main_sizer);
|
||||||
main_sizer->SetSizeHints(this);
|
main_sizer->SetSizeHints(this);
|
||||||
|
|
||||||
// Position window
|
|
||||||
if (lastx == -1 && lasty == -1) {
|
|
||||||
CenterOnParent();
|
|
||||||
} else {
|
|
||||||
Move(lastx, lasty);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fill the controls
|
// Fill the controls
|
||||||
updating_controls = false;
|
updating_controls = false;
|
||||||
int mode = OPT_GET("Tool/Colour Picker/Mode")->GetInt();
|
int mode = OPT_GET("Tool/Colour Picker/Mode")->GetInt();
|
||||||
|
@ -1131,14 +1068,14 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, wxColour initial_color, C
|
||||||
screen_dropper_icon->Connect(wxEVT_MOTION, wxMouseEventHandler(DialogColorPicker::OnDropperMouse), 0, this);
|
screen_dropper_icon->Connect(wxEVT_MOTION, wxMouseEventHandler(DialogColorPicker::OnDropperMouse), 0, this);
|
||||||
screen_dropper_icon->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(DialogColorPicker::OnDropperMouse), 0, this);
|
screen_dropper_icon->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(DialogColorPicker::OnDropperMouse), 0, this);
|
||||||
screen_dropper_icon->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(DialogColorPicker::OnDropperMouse), 0, this);
|
screen_dropper_icon->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(DialogColorPicker::OnDropperMouse), 0, this);
|
||||||
|
|
||||||
|
persist.reset(new PersistLocation(this, "Tool/Colour Picker"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Destructor
|
/// @brief Destructor
|
||||||
///
|
///
|
||||||
DialogColorPicker::~DialogColorPicker()
|
DialogColorPicker::~DialogColorPicker()
|
||||||
{
|
{
|
||||||
GetPosition(&lastx, &lasty);
|
|
||||||
|
|
||||||
delete rgb_spectrum[0];
|
delete rgb_spectrum[0];
|
||||||
delete rgb_spectrum[1];
|
delete rgb_spectrum[1];
|
||||||
delete rgb_spectrum[2];
|
delete rgb_spectrum[2];
|
||||||
|
@ -1802,10 +1739,3 @@ void DialogColorPicker::OnRGBAdjust(wxCommandEvent &evt)
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
int DialogColorPicker::lastx = -1;
|
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
int DialogColorPicker::lasty = -1;
|
|
||||||
|
|
||||||
|
|
|
@ -279,7 +279,12 @@
|
||||||
"Colour Picker" : {
|
"Colour Picker" : {
|
||||||
"Mode" : 4,
|
"Mode" : 4,
|
||||||
"RGBAdjust Tool" : false,
|
"RGBAdjust Tool" : false,
|
||||||
"Recent" : "&H000000& &H0000FF& &H00FFFF& &H00FF00& &HFFFF00& &HFF0000& &HFF00FF& &HFFFFFF&"
|
"Recent" : "&H000000& &H0000FF& &H00FFFF& &H00FF00& &HFFFF00& &HFF0000& &HFF00FF& &HFFFFFF&",
|
||||||
|
"Last" : {
|
||||||
|
"X" : -1,
|
||||||
|
"Y" : -1
|
||||||
|
},
|
||||||
|
"Maximized" : false
|
||||||
},
|
},
|
||||||
"Fonts Collector" : {
|
"Fonts Collector" : {
|
||||||
"Action" : 0
|
"Action" : 0
|
||||||
|
|
Loading…
Reference in a new issue