Skip to content

Commit

Permalink
Use native buttons for the "Find/Replace" dialog
Browse files Browse the repository at this point in the history
Default button for clThemedButton is a generic button

Signed-off-by: Eran Ifrah <[email protected]>
  • Loading branch information
eranif committed Dec 27, 2024
1 parent caa5523 commit 603af24
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 28 deletions.
12 changes: 6 additions & 6 deletions LiteEditor/quickfindbarbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,18 +254,18 @@ clFindReplaceDialogBase::clFindReplaceDialogBase(

flexGridSizer107->Add(m_textCtrlFind, 0, wxALL | wxEXPAND | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(2));

m_buttonFind = new clThemedButton(
m_mainPanel, wxID_FIND, _("Find"), wxDefaultPosition, wxDLG_UNIT(m_mainPanel, wxSize(-1, -1)), 0);
m_buttonFind =
new wxButton(m_mainPanel, wxID_FIND, _("Find"), wxDefaultPosition, wxDLG_UNIT(m_mainPanel, wxSize(-1, -1)), 0);
m_buttonFind->SetDefault();

flexGridSizer107->Add(m_buttonFind, 0, wxALL | wxEXPAND, WXC_FROM_DIP(2));

m_buttonFindPrev = new clThemedButton(
m_buttonFindPrev = new wxButton(
m_mainPanel, wxID_BACKWARD, _("Find Prev"), wxDefaultPosition, wxDLG_UNIT(m_mainPanel, wxSize(-1, -1)), 0);

flexGridSizer107->Add(m_buttonFindPrev, 0, wxALL | wxEXPAND, WXC_FROM_DIP(2));

m_buttonFindAll = new clThemedButton(
m_buttonFindAll = new wxButton(
m_mainPanel, wxID_FIND_ALL, _("Find All"), wxDefaultPosition, wxDLG_UNIT(m_mainPanel, wxSize(-1, -1)), 0);

flexGridSizer107->Add(m_buttonFindAll, 0, wxALL | wxEXPAND, WXC_FROM_DIP(2));
Expand All @@ -278,12 +278,12 @@ clFindReplaceDialogBase::clFindReplaceDialogBase(

flexGridSizer107->Add(m_textCtrlReplace, 0, wxALL | wxEXPAND | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(2));

m_buttonReplace = new clThemedButton(
m_buttonReplace = new wxButton(
m_mainPanel, wxID_REPLACE, _("Replace"), wxDefaultPosition, wxDLG_UNIT(m_mainPanel, wxSize(-1, -1)), 0);

flexGridSizer107->Add(m_buttonReplace, 0, wxALL | wxEXPAND, WXC_FROM_DIP(2));

m_buttonReplaceAll = new clThemedButton(
m_buttonReplaceAll = new wxButton(
m_mainPanel, wxID_REPLACE_ALL, _("Replace All"), wxDefaultPosition, wxDLG_UNIT(m_mainPanel, wxSize(-1, -1)), 0);

flexGridSizer107->Add(m_buttonReplaceAll, 0, wxALL | wxEXPAND, WXC_FROM_DIP(2));
Expand Down
21 changes: 10 additions & 11 deletions LiteEditor/quickfindbarbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <wx/textctrl.h>
#include "clThemedTextCtrl.hpp"
#include <wx/button.h>
#include "clThemedButton.h"
#if wxVERSION_NUMBER >= 2900
#include <wx/persist.h>
#include <wx/persist/toplevel.h>
Expand Down Expand Up @@ -107,12 +106,12 @@ class clFindReplaceDialogBase : public wxDialog
clToolBar* m_toolbar;
wxPanel* m_mainPanel;
clThemedTextCtrl* m_textCtrlFind;
clThemedButton* m_buttonFind;
clThemedButton* m_buttonFindPrev;
clThemedButton* m_buttonFindAll;
wxButton* m_buttonFind;
wxButton* m_buttonFindPrev;
wxButton* m_buttonFindAll;
clThemedTextCtrl* m_textCtrlReplace;
clThemedButton* m_buttonReplace;
clThemedButton* m_buttonReplaceAll;
wxButton* m_buttonReplace;
wxButton* m_buttonReplaceAll;

protected:
virtual void OnEnter(wxCommandEvent& event) { event.Skip(); }
Expand All @@ -136,12 +135,12 @@ class clFindReplaceDialogBase : public wxDialog
public:
clToolBar* GetToolbar() { return m_toolbar; }
clThemedTextCtrl* GetTextCtrlFind() { return m_textCtrlFind; }
clThemedButton* GetButtonFind() { return m_buttonFind; }
clThemedButton* GetButtonFindPrev() { return m_buttonFindPrev; }
clThemedButton* GetButtonFindAll() { return m_buttonFindAll; }
wxButton* GetButtonFind() { return m_buttonFind; }
wxButton* GetButtonFindPrev() { return m_buttonFindPrev; }
wxButton* GetButtonFindAll() { return m_buttonFindAll; }
clThemedTextCtrl* GetTextCtrlReplace() { return m_textCtrlReplace; }
clThemedButton* GetButtonReplace() { return m_buttonReplace; }
clThemedButton* GetButtonReplaceAll() { return m_buttonReplaceAll; }
wxButton* GetButtonReplace() { return m_buttonReplace; }
wxButton* GetButtonReplaceAll() { return m_buttonReplaceAll; }
wxPanel* GetMainPanel() { return m_mainPanel; }
clFindReplaceDialogBase(wxWindow* parent,
wxWindowID id = wxID_ANY,
Expand Down
20 changes: 10 additions & 10 deletions LiteEditor/quickfindbarbase.wxcp
Original file line number Diff line number Diff line change
Expand Up @@ -1306,11 +1306,11 @@
}, {
"type": "string",
"m_label": "Class Name:",
"m_value": "clThemedButton"
"m_value": ""
}, {
"type": "string",
"m_label": "Include File:",
"m_value": "clThemedButton.h"
"m_value": ""
}, {
"type": "string",
"m_label": "Style:",
Expand Down Expand Up @@ -1412,11 +1412,11 @@
}, {
"type": "string",
"m_label": "Class Name:",
"m_value": "clThemedButton"
"m_value": ""
}, {
"type": "string",
"m_label": "Include File:",
"m_value": "clThemedButton.h"
"m_value": ""
}, {
"type": "string",
"m_label": "Style:",
Expand Down Expand Up @@ -1518,11 +1518,11 @@
}, {
"type": "string",
"m_label": "Class Name:",
"m_value": "clThemedButton"
"m_value": ""
}, {
"type": "string",
"m_label": "Include File:",
"m_value": "clThemedButton.h"
"m_value": ""
}, {
"type": "string",
"m_label": "Style:",
Expand Down Expand Up @@ -1739,11 +1739,11 @@
}, {
"type": "string",
"m_label": "Class Name:",
"m_value": "clThemedButton"
"m_value": ""
}, {
"type": "string",
"m_label": "Include File:",
"m_value": "clThemedButton.h"
"m_value": ""
}, {
"type": "string",
"m_label": "Style:",
Expand Down Expand Up @@ -1845,11 +1845,11 @@
}, {
"type": "string",
"m_label": "Class Name:",
"m_value": "clThemedButton"
"m_value": ""
}, {
"type": "string",
"m_label": "Include File:",
"m_value": "clThemedButton.h"
"m_value": ""
}, {
"type": "string",
"m_label": "Style:",
Expand Down
2 changes: 1 addition & 1 deletion Plugin/wxCustomControlsMacOS.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define wxUSE_NATIVE_CHOICE 1
#define wxUSE_NATIVE_BUTTON 1
#define wxUSE_NATIVE_BUTTON 0
#define wxUSE_NATIVE_SCROLLBAR 1
#define wxUSE_NATIVE_MENUBAR 1
#define wxUSE_NATIVE_CAPTION 1
Expand Down

0 comments on commit 603af24

Please sign in to comment.