Hello,
A new version of the patch is ready.
- focus issues fixed.
- problem with cursors solved.
Please check.
--
Stanislav
On Sun, Aug 19, 2007 at 12:15:23PM +1000, Neil Hodgson wrote:
Hi Stanislav,
- cursorLast and the related code was removed because it did not work
with dynamically destroyed/created windows. This removal should
not affect the win32 code.
There are several other platforms (OS/X, wxWidgets, QT, ...) so
published APIs like this should not change. It would also be better to
get this code working on GTK+ to avoid unnecessary calls to
gdk_window_set_cursor. This may now be optimized but I think there was
flickering on old versions of GTK+.
There are new focus issues when switching between horizontal and
vertical layouts. The focus seems to go nowhere so typing has no
effect.
diff -urN scite-1.74-orig/scintilla/gtk/PlatGTK.cxx scite-1.74/scintilla/gtk/PlatGTK.cxx
--- scite-1.74-orig/scintilla/gtk/PlatGTK.cxx 2007-06-15 15:24:38.0 +0400
+++ scite-1.74/scintilla/gtk/PlatGTK.cxx 2007-08-20 19:21:05.0 +0400
@@ -1841,6 +1841,8 @@
cursorLast = curs;
GdkCursor *gdkCurs;
switch (curs) {
+ case cursorInvalid:
+ return;
case cursorText:
gdkCurs = gdk_cursor_new(GDK_XTERM);
break;
diff -urN scite-1.74-orig/scintilla/gtk/ScintillaGTK.cxx scite-1.74/scintilla/gtk/ScintillaGTK.cxx
--- scite-1.74-orig/scintilla/gtk/ScintillaGTK.cxx 2007-06-12 07:55:11.0 +0400
+++ scite-1.74/scintilla/gtk/ScintillaGTK.cxx 2007-08-20 19:21:45.0 +0400
@@ -568,6 +568,9 @@
gtk_widget_unmap(PWidget(wText));
gtk_widget_unmap(PWidget(scrollbarh));
gtk_widget_unmap(PWidget(scrollbarv));
+ wText.SetCursor(Window::cursorInvalid);
+ scrollbarv.SetCursor(Window::cursorInvalid);
+ scrollbarh.SetCursor(Window::cursorInvalid);
}
void ScintillaGTK::UnMap(GtkWidget *widget) {
diff -urN scite-1.74-orig/scite/gtk/SciTEGTK.cxx scite-1.74/scite/gtk/SciTEGTK.cxx
--- scite-1.74-orig/scite/gtk/SciTEGTK.cxx 2007-06-13 18:09:09.0 +0400
+++ scite-1.74/scite/gtk/SciTEGTK.cxx 2007-08-20 17:55:32.0 +0400
@@ -307,11 +307,9 @@
protected:
- Window wDivider;
+ GtkWidget *splitPane;
Point ptOld;
GdkGC *xor_gc;
- bool focusEditor;
- bool focusOutput;
guint sbContextID;
Window wToolBarBox;
@@ -497,11 +495,6 @@
static gint MousePress(GtkWidget *widget, GdkEventButton *event, SciTEGTK *scitew);
gint Mouse(GdkEventButton *event);
- void DividerXOR(Point pt);
- static gint DividerExpose(GtkWidget *widget, GdkEventExpose *ose, SciTEGTK *scitew);
- static gint DividerMotion(GtkWidget *widget, GdkEventMotion *event, SciTEGTK *scitew);
- static gint DividerPress(GtkWidget *widget, GdkEventButton *event, SciTEGTK *scitew);
- static gint DividerRelease(GtkWidget *widget, GdkEventButton *event, SciTEGTK *scitew);
static void DragDataReceived(GtkWidget *widget, GdkDragContext *context,
gint x, gint y, GtkSelectionData *selection_data, guint info, guint time, SciTEGTK *scitew);
@@ -538,6 +531,7 @@
int startID = 0, const char *radioStart = 0);
void CreateMenu();
void CreateUI();
+ void LayoutUI();
void Run(int argc, char *argv[]);
void ProcessExecute();
virtual void Execute();
@@ -595,6 +589,8 @@
btnBuild = 0;
btnStop = 0;
itemFactory = 0;
+ splitPane = 0;
+ heightBar = 0;
fileSelectorWidth = 580;
fileSelectorHeight = 480;
@@ -835,6 +831,13 @@
SizeSubWindows();
CheckMenus();
break;
+ // override base class
+ case IDM_SPLITVERTICAL:
+ splitVertical = !splitVertical;
+ heightBar = 0;
+ LayoutUI();
+ CheckMenus();
+ break;
default:
SciTEBase::MenuCommand(cmdID, menuSource);
@@ -888,30 +891,45 @@
}
void SciTEGTK::SizeContentWindows() {
- PRectangle rcClient = GetClientRectangle();
-#if GTK_MAJOR_VERSION 2
- int left = 0;
- int top = 0;
-#else
- int left = rcClient.left;
- int top = rcClient.top;
-#endif
- int w = rcClient.right - rcClient.left;
- int h = rcClient.bottom - rcClient.top;
- heightOutput = NormaliseSplit(heightOutput);
+// printf(SizeContentWindows: heightOutput = %d, prevHeightOutput = %d, heightBar = %d\n,
+// heightOutput, previousHeightOutput, heightBar);
+ // we come here when receiving resizing signals
+ int height, bar;
if (splitVertical) {
- wEditor.SetPosition(PRectangle(left, top, w - heightOutput - heightBar + left, h + top));
- wDivider.SetPosition(PRectangle(w - heightOutput - heightBar + left, top, w - heightOutput + left, h + top));
- wOutput.SetPosition(PRectangle(w - heightOutput + left, top, w + left, h + top));
+ height = PWidget(wOutput)-allocation.width;
+ bar = splitPane-allocation.width - PWidget(wEditor)-allocation.width - height;
} else {
- wEditor.SetPosition(PRectangle(left, top, w + left, h - heightOutput - heightBar + top));
- wDivider.SetPosition(PRectangle(left, h - heightOutput - heightBar + top, w + left, h - heightOutput + top));
- wOutput.SetPosition(PRectangle(left, h -