mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	FIX: focus state of CheckBox
Change-Id: Iceac4b9877a07e4517250255203c2e0ecdbc34ac
This commit is contained in:
		
							parent
							
								
									ec59446e44
								
							
						
					
					
						commit
						807cc2236d
					
				
					 7 changed files with 38 additions and 16 deletions
				
			
		|  | @ -4,12 +4,15 @@ | |||
| 
 | ||||
| CheckBox::CheckBox(wxWindow* parent) | ||||
| 	: wxBitmapToggleButton(parent, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE) | ||||
|     , m_on(this, "check_on", 16) | ||||
|     , m_half(this, "check_half", 16) | ||||
|     , m_off(this, "check_off", 16) | ||||
|     , m_on_disabled(this, "check_on_disabled", 16) | ||||
|     , m_half_disabled(this, "check_half_disabled", 16) | ||||
|     , m_off_disabled(this, "check_off_disabled", 16) | ||||
|     , m_on(this, "check_on", 18) | ||||
|     , m_half(this, "check_half", 18) | ||||
|     , m_off(this, "check_off", 18) | ||||
|     , m_on_disabled(this, "check_on_disabled", 18) | ||||
|     , m_half_disabled(this, "check_half_disabled", 18) | ||||
|     , m_off_disabled(this, "check_off_disabled", 18) | ||||
|     , m_on_focused(this, "check_on_focused", 18) | ||||
|     , m_half_focused(this, "check_half_focused", 18) | ||||
|     , m_off_focused(this, "check_off_focused", 18) | ||||
| { | ||||
| 	//SetBackgroundStyle(wxBG_STYLE_TRANSPARENT);
 | ||||
| 	if (parent) | ||||
|  | @ -42,6 +45,10 @@ void CheckBox::Rescale() | |||
| 
 | ||||
| void CheckBox::update() | ||||
| { | ||||
| 	SetBitmap((m_half_checked ? m_half : GetValue() ? m_on : m_off).bmp()); | ||||
| 	SetBitmapLabel((m_half_checked ? m_half : GetValue() ? m_on : m_off).bmp()); | ||||
|     SetBitmapDisabled((m_half_checked ? m_half_disabled : GetValue() ? m_on_disabled : m_off_disabled).bmp()); | ||||
|     SetBitmapFocus((m_half_checked ? m_half_focused : GetValue() ? m_on_focused : m_off_focused).bmp()); | ||||
|     SetBitmapCurrent((m_half_checked ? m_half_focused : GetValue() ? m_on_focused : m_off_focused).bmp()); | ||||
| } | ||||
| 
 | ||||
| CheckBox::State CheckBox::GetNormalState() const { return State_Normal; } | ||||
|  |  | |||
|  | @ -17,6 +17,9 @@ public: | |||
| 
 | ||||
| 	void Rescale(); | ||||
| 
 | ||||
| protected: | ||||
|     virtual State GetNormalState() const wxOVERRIDE; | ||||
| 
 | ||||
| private: | ||||
| 	void update(); | ||||
| 
 | ||||
|  | @ -27,6 +30,9 @@ private: | |||
|     ScalableBitmap m_on_disabled; | ||||
|     ScalableBitmap m_half_disabled; | ||||
|     ScalableBitmap m_off_disabled; | ||||
|     ScalableBitmap m_on_focused; | ||||
|     ScalableBitmap m_half_focused; | ||||
|     ScalableBitmap m_off_focused; | ||||
|     bool m_half_checked = false; | ||||
| }; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 chunmao.guo
						chunmao.guo