~ubuntu-branches/debian/squeeze/pgadmin3/squeeze

« back to all changes in this revision

Viewing changes to pgadmin/include/ctl/ctlSQLBox.h

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Porcheron
  • Date: 2008-02-07 00:56:22 UTC
  • mto: (2.1.6 hardy) (6.1.2 sid)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20080207005622-c2ail8p4d0sk3dnw
Tags: upstream-1.8.2
ImportĀ upstreamĀ versionĀ 1.8.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//////////////////////////////////////////////////////////////////////////
 
2
//
 
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
 
7
//
 
8
// ctlSQLBox.h - SQL syntax highlighting textbox
 
9
//
 
10
//////////////////////////////////////////////////////////////////////////
 
11
 
 
12
#ifndef CTLSQLBOX_H
 
13
#define CTLSQLBOX_H
 
14
 
 
15
// wxWindows headers
 
16
#include <wx/wx.h>
 
17
#include <wx/stc/stc.h>
 
18
#include <wx/fdrepdlg.h>
 
19
 
 
20
#include "db/pgConn.h"
 
21
#include "dlg/dlgFindReplace.h"
 
22
 
 
23
// These structs are from Scintilla.h which isn't easily #included :-(
 
24
struct CharacterRange {
 
25
        long cpMin;
 
26
        long cpMax;
 
27
};
 
28
 
 
29
struct TextToFind {
 
30
        struct CharacterRange chrg;
 
31
        char *lpstrText;
 
32
        struct CharacterRange chrgText;
 
33
};
 
34
 
 
35
// Class declarations
 
36
class ctlSQLBox : public wxStyledTextCtrl
 
37
{
 
38
    static wxString sqlKeywords;
 
39
 
 
40
public:
 
41
    ctlSQLBox(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0);
 
42
    ctlSQLBox();
 
43
    ~ctlSQLBox();
 
44
 
 
45
    void Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0);
 
46
 
 
47
        void SetDatabase(pgConn *db);
 
48
 
 
49
    void OnKeyDown(wxKeyEvent& event);
 
50
        void OnAutoComplete(wxCommandEvent& event);
 
51
    void OnSearchReplace(wxCommandEvent& event);
 
52
        void OnKillFocus(wxFocusEvent& event);
 
53
 
 
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; }
 
59
 
 
60
    CharacterRange RegexFindText(int minPos, int maxPos, const wxString& text);
 
61
 
 
62
    DECLARE_DYNAMIC_CLASS(ctlSQLBox)
 
63
    DECLARE_EVENT_TABLE()
 
64
                
 
65
private:
 
66
 
 
67
    void OnPositionStc(wxStyledTextEvent& event);
 
68
 
 
69
    dlgFindReplace* m_dlgFindReplace;
 
70
        pgConn *m_database;
 
71
    bool m_autoIndent;
 
72
};
 
73
 
 
74
 
 
75
#endif