1
//////////////////////////////////////////////////////////////////////////
3
// pgAdmin III - PostgreSQL Tools
4
// RCS-ID: $Id: ctlSQLBox.h 6930 2008-01-02 00:10:01Z dpage $
5
// Copyright (C) 2002 - 2008, The pgAdmin Development Team
6
// This software is released under the Artistic Licence
8
// ctlSQLBox.h - SQL syntax highlighting textbox
10
//////////////////////////////////////////////////////////////////////////
17
#include <wx/stc/stc.h>
18
#include <wx/fdrepdlg.h>
20
#include "db/pgConn.h"
21
#include "dlg/dlgFindReplace.h"
23
// These structs are from Scintilla.h which isn't easily #included :-(
24
struct CharacterRange {
30
struct CharacterRange chrg;
32
struct CharacterRange chrgText;
36
class ctlSQLBox : public wxStyledTextCtrl
38
static wxString sqlKeywords;
41
ctlSQLBox(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0);
45
void Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0);
47
void SetDatabase(pgConn *db);
49
void OnKeyDown(wxKeyEvent& event);
50
void OnAutoComplete(wxCommandEvent& event);
51
void OnSearchReplace(wxCommandEvent& event);
52
void OnKillFocus(wxFocusEvent& event);
54
bool Find(const wxString &find, bool wholeWord, bool matchCase, bool useRegexps, bool startAtTop, bool reverse);
55
bool Replace(const wxString &find, const wxString &replace, bool wholeWord, bool matchCase, bool useRegexps, bool startAtTop, bool reverse);
56
bool ReplaceAll(const wxString &find, const wxString &replace, bool wholeWord, bool matchCase, bool useRegexps);
57
bool DoFind(const wxString &find, const wxString &replace, bool doReplace, bool wholeWord, bool matchCase, bool useRegexps, bool startAtTop, bool reverse);
58
void SetAutoIndent(bool on) { m_autoIndent = on; }
60
CharacterRange RegexFindText(int minPos, int maxPos, const wxString& text);
62
DECLARE_DYNAMIC_CLASS(ctlSQLBox)
67
void OnPositionStc(wxStyledTextEvent& event);
69
dlgFindReplace* m_dlgFindReplace;