Skip to content

Commit 0adeb13

Browse files
Up to 1.9.2
* Add move/zoom to a chart * Filter in a navigation tree by Ctrl + F * Plugins to modify values in a resultset column * Fix issues #161, #163, #164
1 parent a5cd1b8 commit 0adeb13

File tree

9 files changed

+856
-386
lines changed

9 files changed

+856
-386
lines changed

src/dialogs.cpp

Lines changed: 165 additions & 69 deletions
Large diffs are not rendered by default.

src/global.h

Lines changed: 48 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#define MAX_RESULT_COLUMN_COUNT 96
1515
#define MAX_TRANSPOSE_ROWS 512
1616
#define MAX_PLUGIN_COUNT 128
17+
#define MAX_MODIFIER_OUTPUT_LEN 1024
18+
#define MAX_MODIFIER_ERROR_LEN 255
1719

1820
#define DLG_OK 1
1921
#define DLG_CANCEL -1
@@ -27,6 +29,7 @@
2729
#define ACTION_UPDATETAB 6
2830
#define ACTION_REDRAW 7
2931
#define ACTION_SET_THEME 8
32+
#define ACTION_RESET_MODIFIERS 9
3033

3134
#define LOGGER_HIGHLIGHT 1
3235
#define LOGGER_OCCURRENCE 2
@@ -45,7 +48,7 @@
4548

4649
#define ADDON_SQLITE_EXTENSION 0
4750
#define ADDON_VALUE_VIEWER 1
48-
#define ADDON_VALUE_FORMAT 2
51+
#define ADDON_COLUMN_MODIFIER 2
4952

5053
#define EDITOR_HIGHLIGHT TEXT("HIGHLIGHT")
5154
#define EDITOR_PARENTHESIS TEXT("PARENTHESIS")
@@ -85,13 +88,51 @@ extern const char *TYPES8[6];
8588
extern const TCHAR *TYPES16[6];
8689
extern const TCHAR *TYPES16u[6];
8790
extern const TCHAR *TYPES16p[6];
88-
extern const TCHAR* ADDON_TYPES16[3];
91+
extern const TCHAR* ADDON_EXTS16[3];
8992

9093
extern COLORREF GRIDCOLORS[8];
9194
extern HFONT hFont;
9295
extern HFONT hMenuFont;
9396
extern HIMAGELIST hIconsImageList;
9497

98+
typedef HWND (WINAPI *pluginView)(HWND hPreviewWnd, const unsigned char* data, int dataLen, int dataType, TCHAR* outInfo16, TCHAR* outExtension16);
99+
typedef int (WINAPI* pluginClose)(HWND hPluginWnd);
100+
typedef BOOL (WINAPI* pluginActivate)(HWND hListWnd, int colNo, TCHAR* err16);
101+
typedef BOOL (WINAPI* pluginDeactivate)(HWND hListWnd, int colNo);
102+
typedef BOOL (WINAPI *pluginSetText)(HWND hListWnd, int colNo, const unsigned char* data, int dataLen, int dataType, TCHAR* output16);
103+
typedef BOOL (WINAPI *pluginSetColor)(NMLVCUSTOMDRAW* pCustomDraw, const unsigned char* data, int dataLen, int dataType);
104+
typedef BOOL (WINAPI *pluginRender)(NMLVCUSTOMDRAW* pCustomDraw, const unsigned char* data, int dataLen, int dataType);
105+
typedef int (WINAPI* pluginGetPriority)();
106+
107+
struct TPlugin {
108+
HMODULE hModule;
109+
pluginView view;
110+
pluginClose close;
111+
pluginActivate activate;
112+
pluginDeactivate deactivate;
113+
pluginSetText setText;
114+
pluginSetColor setColor;
115+
pluginRender render;
116+
int type;
117+
int priority;
118+
TCHAR name[256];
119+
};
120+
extern TPlugin plugins[MAX_PLUGIN_COUNT + 1];
121+
122+
typedef struct TDlgParam {
123+
const TCHAR* s1;
124+
const TCHAR* s2;
125+
const TCHAR* s3;
126+
const TCHAR* s4;
127+
} TDlgParam;
128+
129+
typedef struct TValue {
130+
const unsigned char* data;
131+
int dataLen;
132+
int dataType;
133+
LONG_PTR extra;
134+
} TValue;
135+
95136
LRESULT CALLBACK cbNewListView(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
96137
LRESULT CALLBACK cbNewEdit(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
97138
LRESULT CALLBACK cbNewEditor(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -124,8 +165,11 @@ void logger(ULONG_PTR type, TCHAR* msg16);
124165

125166
int Toolbar_SetButtonState(HWND hToolbar, int id, byte state, LPARAM lParam = 0);
126167
DWORD_PTR Toolbar_GetButtonData(HWND hToolbar, int id);
168+
LPARAM TreeView_GetItemParam (HWND hTreeWnd, HTREEITEM hItem);
127169
int ListView_SetData(HWND hListWnd, sqlite3_stmt *stmt, bool isRef = false);
128170
int ListView_ShowRef(HWND hListWnd, int rowNo, int colNo);
171+
BOOL ListView_GetItemValue(HWND hListWnd, int rowNo, int colNo, TValue* cell, bool ignoreResultset = false);
172+
TCHAR* ListView_GetItemValueText(HWND hListWnd, int rowNo, int colNo, bool ignoreResultset = false);
129173
int ListView_Sort(HWND hListWnd, int colNo);
130174
int ListView_Reset(HWND hListWnd);
131175
int ListView_GetColumnCount(HWND hListWnd);
@@ -138,36 +182,12 @@ BOOL Menu_SetItemStateByPosition(HMENU hMenu, UINT pos, UINT fState);
138182
BOOL Menu_InsertItem(HMENU hMenu, UINT uPosition, UINT wID, UINT fState, const TCHAR* pszText);
139183
BOOL Menu_SetData(HMENU hMenu, ULONG_PTR data);
140184
ULONG_PTR Menu_GetData(HMENU hMenu);
185+
BOOL Menu_SetItemData(HMENU hMenu, UINT wID, ULONG_PTR lParam);
186+
ULONG_PTR Menu_GetItemData(HMENU hMenu, UINT wID);
141187

142188
COLORREF RichEdit_GetTextColor (HWND hWnd, int pos);
143189
int TabCtrl_GetItemText(HWND hWnd, int iItem, TCHAR* pszText, int cchTextMax);
144190
LRESULT onListViewMenu(HWND hListWnd, int rowNo, int colNo, int cmd, bool ignoreLastColumn = false);
145191
TCHAR* getDDL(const TCHAR* schema16, const TCHAR* name16, int type, bool withDrop = false);
146192
bool showDbError(HWND hWnd);
147-
148-
typedef HWND (WINAPI *pluginView)(HWND hPreviewWnd, const unsigned char* data, int dataLen, int dataType, TCHAR* outInfo16, TCHAR* outExtension16);
149-
typedef int (WINAPI* pluginClose)(HWND hPluginWnd);
150-
typedef int (WINAPI* pluginGetPriority)();
151-
struct TPlugin {
152-
HMODULE hModule;
153-
pluginView view;
154-
pluginClose close;
155-
int type;
156-
int priority;
157-
};
158-
extern TPlugin plugins[MAX_PLUGIN_COUNT];
159-
160-
typedef struct TDlgParam {
161-
const TCHAR* s1;
162-
const TCHAR* s2;
163-
const TCHAR* s3;
164-
const TCHAR* s4;
165-
} TDlgParam;
166-
167-
typedef struct TDlgValueParam {
168-
int dataType;
169-
const unsigned char* data;
170-
LONG_PTR extra;
171-
} TDlgValueParam;
172-
173193
#endif

0 commit comments

Comments
 (0)