annotate src/gui_kde.cc @ 355:644578c9e219

updated for version 7.0092
author vimboss
date Fri, 24 Jun 2005 23:01:23 +0000
parents fca8a9b65afa
children d5dbe17efce2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
1 /* vi:set ts=8 sts=4 sw=4:
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
2 *
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
3 * VIM - Vi IMproved by Bram Moolenaar
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
4 *
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
5 * Do ":help uganda" in Vim to read copying and usage conditions.
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
6 * Do ":help credits" in Vim to see a list of people who contributed.
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
7 */
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
8
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
9 /*
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
10 * Porting to KDE(2) was done by
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
11 *
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
12 * (C) 2000 by Thomas Capricelli <orzel@freehackers.org>
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
13 *
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
14 * Please visit http://freehackers.org/kvim for other vim- or
233
fca8a9b65afa updated for version 7.0065
vimboss
parents: 75
diff changeset
15 * kde-related coding. (URL currently doesn't work...)
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
16 *
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
17 * $Id$
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
18 *
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
19 */
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
20 #include <assert.h>
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
21 #include <errno.h>
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
22 #include <string.h>
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
23 #include <kmenubar.h>
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
24 #include <kfiledialog.h>
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
25 #include <kiconloader.h>
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
26
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
27 #include <qscrollbar.h>
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
28 #include <qcursor.h>
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
29 #include <qmessagebox.h>
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
30 #include <qiconset.h>
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
31 #include <qtextcodec.h>
20
4ac1dce8dd5e updated for version 7.0012
vimboss
parents: 11
diff changeset
32 #include "gui_kde_wid.h"
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
33
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
34 extern "C" {
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
35 #include "vim.h"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
36 }
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
37
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
38 #undef dbf
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
39 #undef db
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
40 #undef mputs
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
41
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
42 #if 1
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
43 #define dbf(format, args...) { printf("%s" " : " format "\n" , __FUNCTION__ , ## args ); fflush(stdout); }
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
44 #define db() { printf("%s\n", __FUNCTION__ );fflush(stdout); }
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
45 #else
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
46 #define dbf(format, args... )
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
47 #define db()
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
48 #endif
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
49
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
50
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
51 #ifdef FEAT_TOOLBAR
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
52 #ifndef FEAT_KDETOOLBAR
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
53 /*
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
54 * Icons used by the toolbar code.
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
55 *///{{{
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
56 #include "../pixmaps/tb_new.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
57 #include "../pixmaps/tb_open.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
58 #include "../pixmaps/tb_close.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
59 #include "../pixmaps/tb_save.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
60 #include "../pixmaps/tb_print.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
61 #include "../pixmaps/tb_cut.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
62 #include "../pixmaps/tb_copy.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
63 #include "../pixmaps/tb_paste.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
64 #include "../pixmaps/tb_find.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
65 #include "../pixmaps/tb_find_next.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
66 #include "../pixmaps/tb_find_prev.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
67 #include "../pixmaps/tb_find_help.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
68 #include "../pixmaps/tb_exit.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
69 #include "../pixmaps/tb_undo.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
70 #include "../pixmaps/tb_redo.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
71 #include "../pixmaps/tb_help.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
72 #include "../pixmaps/tb_macro.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
73 #include "../pixmaps/tb_make.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
74 #include "../pixmaps/tb_save_all.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
75 #include "../pixmaps/tb_jump.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
76 #include "../pixmaps/tb_ctags.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
77 #include "../pixmaps/tb_load_session.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
78 #include "../pixmaps/tb_save_session.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
79 #include "../pixmaps/tb_new_session.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
80 #include "../pixmaps/tb_blank.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
81 #include "../pixmaps/tb_maximize.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
82 #include "../pixmaps/tb_split.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
83 #include "../pixmaps/tb_minimize.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
84 #include "../pixmaps/tb_shell.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
85 #include "../pixmaps/tb_replace.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
86 #include "../pixmaps/tb_vsplit.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
87 #include "../pixmaps/tb_maxwidth.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
88 #include "../pixmaps/tb_minwidth.xpm"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
89 //}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
90 /*
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
91 * These are the pixmaps used for the default buttons.
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
92 * Order must exactly match toolbar_names[] in menu.c!
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
93 *///{{{
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
94 static char **(built_in_pixmaps[]) =
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
95 {
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
96 tb_new_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
97 tb_open_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
98 tb_save_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
99 tb_undo_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
100 tb_redo_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
101 tb_cut_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
102 tb_copy_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
103 tb_paste_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
104 tb_print_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
105 tb_help_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
106 tb_find_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
107 tb_save_all_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
108 tb_save_session_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
109 tb_new_session_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
110 tb_load_session_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
111 tb_macro_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
112 tb_replace_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
113 tb_close_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
114 tb_maximize_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
115 tb_minimize_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
116 tb_split_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
117 tb_shell_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
118 tb_find_prev_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
119 tb_find_next_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
120 tb_find_help_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
121 tb_make_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
122 tb_jump_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
123 tb_ctags_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
124 tb_vsplit_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
125 tb_maxwidth_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
126 tb_minwidth_xpm,
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
127 tb_exit_xpm
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
128 };//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
129 #else
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
130 const char *kdeicons[] = {
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
131 "filenew",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
132 "fileopen",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
133 "filesave",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
134 "undo",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
135 "redo",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
136 "editcut",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
137 "editcopy",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
138 "editpaste",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
139 "fileprint",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
140 "contents2",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
141 "filefind",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
142 "save_all",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
143 "fileexport",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
144 "filenew",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
145 "fileimport",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
146 "run",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
147 "edit",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
148 "fileclose",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
149 "",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
150 "",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
151 "split",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
152 "openterm",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
153 "previous",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
154 "next",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
155 "help",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
156 "make",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
157 "goto",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
158 "run",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
159 "vsplit",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
160 "maxwidth",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
161 "minwidth",
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
162 "quit"
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
163 };
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
164 #endif
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
165 /*
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
166 * creates a blank pixmap using tb_blank
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
167 */
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
168 QPixmap
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
169 pixmap_create_from_xpm(char **xpm)//{{{
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
170 {
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
171 return (QPixmap((const char **)xpm));
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
172 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
173
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
174 /*
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
175 * creates a pixmap by using a built-in number
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
176 */
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
177 QPixmap
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
178 pixmap_create_by_num(int pixmap_num)//{{{
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
179 {
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
180 #ifdef FEAT_KDETOOLBAR
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
181 if (pixmap_num >= 0 && (unsigned)pixmap_num < (sizeof(kdeicons)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
182 / sizeof(kdeicons[0])) - 1)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
183 {
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
184
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
185 KIconLoader *il = kapp->iconLoader(); //new KIconLoader();
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
186 QString icon;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
187 icon = QString(kdeicons[pixmap_num]);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
188 return il->loadIcon(icon, KIcon::MainToolbar);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
189 }
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
190 return QPixmap();
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
191 #else
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
192 if (pixmap_num >= 0 && (unsigned)pixmap_num < (sizeof(built_in_pixmaps)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
193 / sizeof(built_in_pixmaps[0])) - 1)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
194 return pixmap_create_from_xpm(built_in_pixmaps[pixmap_num]);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
195 else
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
196 return QPixmap();
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
197 #endif
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
198 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
199
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
200 /*
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
201 * Creates a pixmap by using the pixmap "name" found in 'runtimepath'/bitmaps/
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
202 */
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
203 QPixmap
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
204 pixmap_create_by_dir(char_u *name)//{{{
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
205 {
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
206 char_u full_pathname[MAXPATHL + 1];
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
207
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
208 if (gui_find_bitmap(name, full_pathname, "xpm") == OK)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
209 return QPixmap((const char *)full_pathname);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
210 else
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
211 return QPixmap();
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
212 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
213
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
214
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
215 QPixmap
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
216 pixmap_create_from_file(char_u *file)
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
217 {
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
218 return QPixmap((const char *)file);
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
219 }
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
220 #endif
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
221
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
222 void
42
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
223 gui_mch_add_menu(vimmenu_T *menu, int idx)//{{{
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
224 {
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
225 #ifdef FEAT_MENU
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
226 QPopupMenu *me;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
227 vimmenu_T *parent = menu->parent;
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
228
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
229 if (menu_is_popup(menu->name))
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
230 {
42
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
231 menu->widget = new QPopupMenu(vmw , QSTR(menu->name));
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
232 QObject::connect(menu->widget, SIGNAL(activated(int)), vmw,
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
233 SLOT(menu_activated(int)));
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
234 return;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
235 }
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
236
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
237 if (!menu_is_menubar(menu->name))
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
238 return;
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
239
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
240 if (parent)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
241 {
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
242 idx++; // for tearoffs to be first in menus
42
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
243 me = new QPopupMenu(parent->widget, QSTR(menu->name));
75
388f285bda1b updated for version 7.0031
vimboss
parents: 45
diff changeset
244 parent->widget->insertItem(QSTR(menu->name), me, (long)me, idx);
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
245 }
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
246 else
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
247 {
42
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
248 me = new QPopupMenu(vmw->menuBar(), QSTR(menu->name));
75
388f285bda1b updated for version 7.0031
vimboss
parents: 45
diff changeset
249 vmw->menuBar()->insertItem(QSTR(menu->name), me, (long)me, idx);
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
250 }
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
251
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
252 me->setCaption((const char *)(menu->dname));
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
253 if (vmw->have_tearoff)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
254 me->insertTearOffHandle(0, 0);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
255 QObject::connect(me, SIGNAL(activated(int)), vmw,
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
256 SLOT(menu_activated(int)));
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
257 menu->widget = me;
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
258 #endif
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
259 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
260
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
261
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
262 void
42
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
263 gui_mch_add_menu_item(vimmenu_T *menu, int idx)//{{{
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
264 {
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
265 #ifdef FEAT_MENU
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
266 vimmenu_T *parent = menu->parent;
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
267 #ifdef FEAT_TOOLBAR
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
268 if (menu_is_toolbar(parent->name))
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
269 {
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
270 QPixmap pix;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
271
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
272 if (menu_is_separator(menu->name))
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
273 {
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
274 vmw->toolBar()->insertSeparator();
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
275 return;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
276 }
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
277 if (menu->iconfile != NULL)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
278 {
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
279 pix = pixmap_create_from_file(menu->iconfile);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
280 }
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
281 if (!menu->icon_builtin)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
282 {
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
283 pix = pixmap_create_by_dir(menu->name);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
284 }
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
285 if (pix.isNull() && menu->iconidx >= 0)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
286 {
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
287 pix = pixmap_create_by_num(menu->iconidx);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
288 }
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
289 #ifndef FEAT_KDETOOLBAR
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
290 if (pix.isNull())
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
291 {
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
292 pix = pixmap_create_from_xpm(tb_blank_xpm);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
293 }
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
294 #endif
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
295 if (pix.isNull())
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
296 return; // failed
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
297 vmw->toolBar()->insertButton(
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
298 pix,
75
388f285bda1b updated for version 7.0031
vimboss
parents: 45
diff changeset
299 (long)menu, // id
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
300 true,
42
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
301 QSTR(menu->strings[MENU_INDEX_TIP]), // tooltip or text
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
302 idx);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
303 menu->parent=parent;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
304 return;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
305 }
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
306 #endif // FEAT_TOOLBAR
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
307
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
308 idx++;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
309 if (menu_is_separator(menu->name))
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
310 {
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
311 parent->widget->insertSeparator();
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
312 return;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
313 }
75
388f285bda1b updated for version 7.0031
vimboss
parents: 45
diff changeset
314 parent->widget->insertItem(QSTR(menu->name), (long)menu, idx);
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
315 #endif
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
316 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
317
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
318
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
319 void
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
320 gui_mch_set_text_area_pos(int x, int y, int w, int h)//{{{
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
321 {
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
322 int X = 0;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
323 int Y = 0;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
324
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
325 if (vmw->menuBar()->isVisible() && vmw->menuBar()->isEnabled()
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
326 #if QT_VERSION>=300
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
327 && !vmw->menuBar()->isTopLevelMenu()
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
328 #endif
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
329 )
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
330 Y += vmw->menuBar()->height();
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
331 #ifdef FEAT_TOOLBAR
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
332 if (vmw->toolBar()->isVisible() && vmw->toolBar()->isEnabled()
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
333 && vmw->toolBar()->barPos()==KToolBar::Top)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
334 Y += vmw->toolBar()->height();
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
335
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
336 if (vmw->toolBar()->isVisible() && vmw->toolBar()->isEnabled()
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
337 && vmw->toolBar()->barPos()==KToolBar::Left)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
338 X += vmw->toolBar()->width();
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
339 #endif // FEAT_TOOLBAR
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
340
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
341 gui.w->setGeometry(x + X, y + Y, w, h);
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
342 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
343
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
344
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
345 #if defined(FEAT_MENU) || defined(PROTO)
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
346 /*
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
347 * Enable or disable mnemonics for the toplevel menus.
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
348 */
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
349 void
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
350 gui_gtk_set_mnemonics(int enable)//{{{ // TO BE REMOVED
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
351 {
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
352 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
353
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
354 void
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
355 toggle_tearoffs(vimmenu_T *menu, int enable)//{{{
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
356 {
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
357 while (menu != NULL)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
358 {
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
359 if (!menu_is_popup(menu->name))
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
360 {
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
361 if (menu->widget != 0)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
362 {
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
363 if (enable)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
364 menu->widget->insertTearOffHandle(0,0);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
365 else
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
366 menu->widget->removeItem(0);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
367 }
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
368 toggle_tearoffs(menu->children, enable);
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
369 }
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
370 menu = menu->next;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
371 }
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
372 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
373
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
374 void
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
375 gui_mch_toggle_tearoffs(int enable)//{{{
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
376 {
42
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
377 vmw->have_tearoff=enable;
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
378 toggle_tearoffs(root_menu, enable);
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
379 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
380 #endif
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
381
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
382
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
383 #if defined(FEAT_MENU) || defined(PROTO)
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
384 /*
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
385 * Destroy the machine specific menu widget.
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
386 */
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
387 void
42
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
388 gui_mch_destroy_menu(vimmenu_T *menu)//{{{
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
389 {
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
390 #ifdef FEAT_TOOLBAR
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
391 if (menu->parent && menu_is_toolbar(menu->parent->name))
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
392 {
75
388f285bda1b updated for version 7.0031
vimboss
parents: 45
diff changeset
393 vmw->toolBar()->removeItem((long)menu);
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
394 return;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
395 }
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
396 #endif
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
397 if (menu->parent)
75
388f285bda1b updated for version 7.0031
vimboss
parents: 45
diff changeset
398 menu->parent->widget->removeItem((long)menu);
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
399 if (menu->widget)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
400 delete menu->widget;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
401 menu->widget = 0;
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
402 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
403 #endif /* FEAT_MENU */
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
404
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
405
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
406 /*
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
407 * Scrollbar stuff.
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
408 */
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
409
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
410 void
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
411 gui_mch_set_scrollbar_thumb(scrollbar_T *sb, long val, long size, long max)//{{{
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
412 {
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
413 if (!sb->w)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
414 return;
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
415
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
416 sb->w->setRange(0, max + 1 - size);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
417 sb->w->setValue(val);
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
418
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
419 sb->w->setLineStep(1);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
420 sb->w->setPageStep(size);
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
421 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
422
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
423 void
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
424 gui_mch_set_scrollbar_pos(scrollbar_T *sb, int x, int y, int w, int h)//{{{
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
425 {
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
426 if (!sb->w)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
427 return;
42
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
428
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
429 //we add the menubar and toolbar height/width
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
430 int X = 0;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
431 int Y = 0;
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
432
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
433 if (vmw->menuBar()->isVisible() && vmw->menuBar()->isEnabled()
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
434 #if QT_VERSION>=300
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
435 && !vmw->menuBar()->isTopLevelMenu()
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
436 #endif
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
437 )
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
438 Y += vmw->menuBar()->height();
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
439 #ifdef FEAT_TOOLBAR
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
440 if (vmw->toolBar()->isVisible() && vmw->toolBar()->isEnabled()
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
441 && vmw->toolBar()->barPos()==KToolBar::Top)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
442 Y += vmw->toolBar()->height();
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
443
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
444 if (vmw->toolBar()->isVisible() && vmw->toolBar()->isEnabled()
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
445 && vmw->toolBar()->barPos()==KToolBar::Left)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
446 X += vmw->toolBar()->width();
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
447 #endif //FEAT_TOOLBAR
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
448 if (sb->w->orientation() == Qt::Vertical)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
449 {
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
450 bool leftscroll=gui.which_scrollbars[SBAR_LEFT];
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
451 bool rightscroll=gui.which_scrollbars[SBAR_RIGHT];
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
452
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
453 if (x < 20)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
454 leftscroll = true;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
455 else
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
456 rightscroll = true;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
457 if (x < 20)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
458 sb->w->setGeometry(X, y+Y, w, h);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
459 else
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
460 sb->w->setGeometry(vmw->width() - w - 1 + X, y + Y, w, h);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
461 }
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
462 else
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
463 {
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
464 sb->w->setGeometry(x + X, y + Y, w, h);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
465 }
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
466 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
467
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
468 /* SBAR_VERT or SBAR_HORIZ */
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
469 void
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
470 gui_mch_create_scrollbar(scrollbar_T *sb, int orient)//{{{
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
471 {
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
472 sbpool->create(sb,orient);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
473 if (orient == SBAR_VERT)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
474 gui.scrollbar_width = sb->w->sizeHint().width();
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
475 else
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
476 gui.scrollbar_height = sb->w->sizeHint().height();
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
477 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
478
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
479 void
42
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
480 gui_mch_destroy_scrollbar(scrollbar_T *sb)//{{{
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
481 {
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
482 sbpool->destroy(sb);
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
483 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
484
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
485 #if defined(FEAT_BROWSE) || defined(PROTO)
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
486 /*
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
487 * Implementation of the file selector related stuff
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
488 */
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
489
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
490 /*
45
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
491 * Convert the Vim-style filter specification 's' to the KDE-style
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
492 * filter specification.
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
493 * Vim-style: {label}\t{pattern1};{pattern2}\n
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
494 * KDE-style: {pattern1} {pattern2}|{label}\n
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
495 *
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
496 * The newly constructed filter is returned in allocated memory and
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
497 * must be freed by the calling program.
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
498 */
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
499 static char *
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
500 convert_filter(char_u *s)
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
501 {
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
502 char *res;
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
503 unsigned i;
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
504 unsigned pattern_len;
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
505 char *filter_label;
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
506 char *filter_pattern;
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
507
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
508 // The conversion generates a string of equal length to the original
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
509 // pattern, so allocate enough memory to hold the original string.
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
510 res = new char[STRLEN(s) + 1];
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
511 s = vim_strsave(s);
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
512 if (res != NULL && s != NULL)
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
513 {
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
514 // Make sure the first byte is a NUL so that strcat()
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
515 // will append at the beginning of the string.
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
516 res[0] = '\0';
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
517 filter_label = strtok((char *) s, "\t");
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
518 while (filter_label != NULL)
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
519 {
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
520 filter_pattern = strtok( 0L, "\n");
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
521 if (filter_pattern != NULL)
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
522 {
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
523 pattern_len = (unsigned) STRLEN(filter_pattern);
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
524 for (i = 0; i < pattern_len; ++i)
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
525 if (filter_pattern[i] == ';')
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
526 filter_pattern[i] = ' ';
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
527
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
528 strcat(res, filter_pattern);
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
529 strcat(res, "|");
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
530 strcat(res, filter_label);
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
531 strcat(res, "\n");
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
532 }
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
533 filter_label = strtok(0L, "\t");
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
534 }
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
535 }
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
536 if (s)
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
537 vim_free(s);
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
538 return res;
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
539 }
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
540
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
541 /*
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
542 * Put up a file requester.
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
543 * Returns the selected name in allocated memory, or NULL for Cancel.
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
544 * saving, select file to write
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
545 * title title for the window
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
546 * dflt default name
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
547 * ext not used (extension added)
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
548 * initdir initial directory, NULL for current dir
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
549 * filter not used (file name filter)
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
550 */
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
551 /*ARGSUSED*/
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
552 char_u *
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
553 gui_mch_browse(int saving,//{{{
42
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
554 char_u *title,
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
555 char_u *dflt,
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
556 char_u *ext,
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
557 char_u *initdir,
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
558 char_u *filter)
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
559 {
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
560 char *filt_glob;
23
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
561
45
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
562 filt_glob = convert_filter(filter);
23
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
563
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
564 gui_mch_mousehide(FALSE);
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
565
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
566 QString s;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
567 if (!saving)
42
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
568 s = KFileDialog::getOpenFileName(QSTR(initdir), QSTR(filt_glob),
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
569 vmw, QSTR(title));
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
570 else
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
571 s = KFileDialog::getSaveFileName();
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
572
45
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
573 if (filt_glob)
e474bae3795f updated for version 7.0027
vimboss
parents: 42
diff changeset
574 delete filt_glob;
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
575
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
576 if (s.isNull())
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
577 return NULL;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
578 QCString unistring = vmw->codec->fromUnicode(s);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
579 char_u *s2 = (char_u *)(const char *)unistring;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
580 if (s2)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
581 s2 = vim_strsave(s2);
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
582
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
583 return s2;
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
584 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
585
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
586 #endif /* FEAT_BROWSE */
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
587
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
588 #ifdef FEAT_GUI_DIALOG
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
589
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
590 /* ARGSUSED */
23
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
591 int
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
592 gui_mch_dialog(int type, /* type of dialog *///{{{
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
593 char_u *title, /* title of dialog */
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
594 char_u *message, /* message text */
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
595 char_u *buttons, /* names of buttons */
42
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
596 int def_but, /* default button */
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
597 char_u *textfield)
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
598 {
23
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
599 gui_mch_mousehide(FALSE);
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
600 VimDialog vd(type, title, message, buttons, def_but,textfield);
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
601 int ret = vd.exec();
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
602 return ret;
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
603 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
604
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
605
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
606 #endif /* FEAT_GUI_DIALOG */
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
607
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
608 #if defined(FEAT_MENU) || defined(PROTO)
23
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
609 void
42
c75153d791d0 updated for version 7.0026
vimboss
parents: 39
diff changeset
610 gui_mch_show_popupmenu(vimmenu_T *menu)//{{{
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
611 {
23
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
612 menu->widget->popup(QCursor::pos());
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
613 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
614
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
615 void
23
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
616 gui_make_popup (char_u *pathname)//{{{
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
617 {
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
618 vimmenu_T *menu = gui_find_menu(pathname);
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
619
23
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
620 if (menu != NULL)
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
621 menu->widget->popup(QCursor::pos());
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
622 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
623 #endif
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
624
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
625
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
626
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
627 /* Find and Replace implementations */
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
628 void
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
629 gui_mch_find_dialog(exarg_T *eap)//{{{
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
630 {
23
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
631 // char_u* entry_text;
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
632 //int exact_word=FALSE;
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
633 // entry_text = get_find_dialog_text(eap->arg,&exact_word);
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
634
23
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
635 vmw->finddlg->setCaseSensitive(true);
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
636
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
637 /* if (entry_text!=NULL)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
638 * {
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
639 vmw->finddlg->setText(QString((char *)entry_text));
23
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
640 // exact match should go there, hopefully KDE old KEdFind/KEdReplace will be replaced in KDE 4 as pple wanted KDE 3's Find/Replace to be kept
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
641 }*/ // Don't use it, KDE keeps old search in memory and vim give \\Csearch, which is difficult to handle
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
642 // vim_free(entry_text);
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
643
23
3f44e9abe4ec updated for version 7.0015
vimboss
parents: 20
diff changeset
644 vmw->finddlg->show();
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
645 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
646
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
647 void
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
648 gui_mch_replace_dialog(exarg_T *eap)//{{{
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
649 {
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
650 // char_u* entry_text;
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
651 //int exact_word=FALSE;
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
652
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
653 // entry_text = get_find_dialog_text(eap->arg,&exact_word);
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
654
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
655 /* if (entry_text!=NULL)
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
656 * {
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
657 vmw->repldlg->setText(QString((char *)entry_text));
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
658 // exact match should go there, hopefully KDE old KEdFind/KEdReplace will be replaced in KDE 4 as pple wanted KDE 3's Find/Replace to be kept
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
659 }*/
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
660 //vim_free(entry_text);
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
661
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
662 vmw->repldlg->show();
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
663 }//}}}
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
664
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
665 void
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
666 ex_helpfind(exarg_T *eap)//{{{
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
667 {
39
410fa1a31baf updated for version 7.0023
vimboss
parents: 23
diff changeset
668 do_cmdline_cmd((char_u *)"emenu ToolBar.FindHelp");
11
4424b47a0797 updated for version 7.0003
vimboss
parents:
diff changeset
669 }//}}}