gambas-source-code/gb.gtk/src/gmainwindow.cpp

1244 lines
24 KiB
C++
Raw Normal View History

/***************************************************************************
gmainwindow.cpp
(c) 2004-2006 - Daniel Campos Fernández <dcamposf@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
***************************************************************************/
#include <ctype.h>
#include <time.h>
#include "widgets.h"
#include "widgets_private.h"
#ifdef GDK_WINDOWING_X11
#include <X11/extensions/shape.h>
#endif
[CONFIGURATION] * BUG: Libraries and include files are automatically searched inside 64 bits specific directories. [DEVELOPMENT ENVIRONMENT] * NEW: Automatically convert old Border property to the new Border and Resizable properties. * BUG: The "Theme" tab of the option dialog is correctly initialized the first time Gambas is run. * BUG: Going to a non-existing line number in the editor does not crash the IDE anymore. * NEW: The IDE forms now use the new Border, Resizable and Type properties of the Window class. [COMPILER] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.EVAL] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.GTK] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. [GB.QT] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. git-svn-id: svn://localhost/gambas/trunk@1321 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-04-18 23:43:38 +00:00
#include "x11.h"
#include "gapplication.h"
#include "gdesktop.h"
#include "gkey.h"
#include "gmenu.h"
#include "gmessage.h"
#include "gdialog.h"
#include "gmainwindow.h"
static gboolean win_frame(GtkWidget *widget,GdkEventWindowState *event,gMainWindow *data)
{
data->performArrange();
return false;
}
static void cb_show (GtkWidget *widget, gMainWindow *data)
{
data->emitOpen();
if (data->opened)
{
//data->performArrange();
data->emit(SIGNAL(data->onShow));
data->_not_spontaneous = false;
}
}
static void cb_hide (GtkWidget *widget, gMainWindow *data)
{
data->emit(SIGNAL(data->onHide));
data->_not_spontaneous = false;
if (data == gDesktop::activeWindow())
gMainWindow::setActiveWindow(NULL);
}
static gboolean win_close(GtkWidget *widget,GdkEvent *event,gMainWindow *data)
{
if (!gMainWindow::_current || data == gMainWindow::_current)
data->doClose();
return true;
}
static gboolean resize_later(gMainWindow *data)
{
data->bufW = data->_next_w;
data->bufH = data->_next_h;
data->_next_timer = 0;
[DEVELOPMENT ENVIRONMENT] * BUG: The button that switches between form and class editor is not shown anymore when a module or a class is edited. [GB.GTK] * BUG: Font management was redesigned. It does not leak memory anymore, and now behaves like in gb.qt. * BUG: Tristate CheckBox controls now work as expected. * BUG: Destroy pending deleted controls before entering the event loop, to avoid some memory leaks if the event loop is immediately aborted. * BUG: Detach destroyed controls from their event listener, as in gb.qt. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. [GB.QT] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Showing a tray icon does not eat focus events anymore. * NEW: Top-level menus with a void Text property are not shown anymore. [GB.QT4] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Shortcut management was fixed. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. git-svn-id: svn://localhost/gambas/trunk@2034 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2009-06-22 11:16:34 +00:00
data->configure();
data->performArrange();
if (data->onResize)
data->onResize(data);
data->refresh();
return false;
}
static gboolean cb_configure(GtkWidget *widget, GdkEventConfigure *event, gMainWindow *data)
{
gint x, y;
//fprintf(stderr, "cb_configure: %p\n", data);
if (data->opened)
{
if (data->isTopLevel())
gtk_window_get_position(GTK_WINDOW(data->border), &x, &y);
else
{
x = event->x;
y = event->y;
}
if (x != data->bufX || y != data->bufY)
{
data->bufX = x;
data->bufY = y;
if (data->onMove) data->onMove(data);
}
if ( (event->width!=data->bufW) || (event->height!=data->bufH) || (data->_resized) || !event->window )
{
data->_next_w = event->width;
data->_next_h = event->height;
/* data->bufW=event->width;
data->bufH=event->height;
//g_debug("gMainWindow: cb_configure: %d", event->send_event);
data->performArrange();
if (data->onResize) data->onResize(data);*/
//if (data->_resized || data->parent())
//{
data->_resized = false;
resize_later(data);
/*}
else
{
//resize_later(data);
if (!data->_next_timer)
data->_next_timer = g_timeout_add(50, (GSourceFunc)resize_later, data);
}*/
}
}
return false;
}
static void cb_open(GtkWidget *widget, GdkEvent *e, gMainWindow *data)
{
data->emitOpen();
}
static gboolean cb_expose(GtkWidget *wid, GdkEventExpose *e, gMainWindow *data)
{
if (data->_background)
{
gdk_window_clear(data->border->window);
gdk_window_clear(GTK_LAYOUT(data->widget)->bin_window);
}
return false;
}
GList *gMainWindow::windows = NULL;
gMainWindow *gMainWindow::_active = NULL;
gMainWindow *gMainWindow::_current = NULL;
void gMainWindow::initialize()
{
//fprintf(stderr, "new window: %p in %p\n", this, parent());
opened = false;
sticky = false;
persistent = false;
stack = 0;
_type = 0;
_mask = false;
_masked = false;
_resized = false;
accel = NULL;
_default = NULL;
_cancel = NULL;
menuBar = NULL;
[DEVELOPMENT ENVIRONMENT] * BUG: The button that switches between form and class editor is not shown anymore when a module or a class is edited. [GB.GTK] * BUG: Font management was redesigned. It does not leak memory anymore, and now behaves like in gb.qt. * BUG: Tristate CheckBox controls now work as expected. * BUG: Destroy pending deleted controls before entering the event loop, to avoid some memory leaks if the event loop is immediately aborted. * BUG: Detach destroyed controls from their event listener, as in gb.qt. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. [GB.QT] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Showing a tray icon does not eat focus events anymore. * NEW: Top-level menus with a void Text property are not shown anymore. [GB.QT4] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Shortcut management was fixed. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. git-svn-id: svn://localhost/gambas/trunk@2034 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2009-06-22 11:16:34 +00:00
layout = NULL;
top_only = false;
_icon = NULL;
_picture = NULL;
focus = 0;
_closing = false;
_title = NULL;
_not_spontaneous = false;
_skip_taskbar = false;
_current = NULL;
_background = NULL;
_style = NULL;
_next_timer = 0;
_xembed = false;
_activate = false;
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
_hidden = false;
[DEVELOPMENT ENVIRONMENT] * BUG: The button that switches between form and class editor is not shown anymore when a module or a class is edited. [GB.GTK] * BUG: Font management was redesigned. It does not leak memory anymore, and now behaves like in gb.qt. * BUG: Tristate CheckBox controls now work as expected. * BUG: Destroy pending deleted controls before entering the event loop, to avoid some memory leaks if the event loop is immediately aborted. * BUG: Detach destroyed controls from their event listener, as in gb.qt. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. [GB.QT] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Showing a tray icon does not eat focus events anymore. * NEW: Top-level menus with a void Text property are not shown anymore. [GB.QT4] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Shortcut management was fixed. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. git-svn-id: svn://localhost/gambas/trunk@2034 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2009-06-22 11:16:34 +00:00
_hideMenuBar = false;
_showMenuBar = true;
onOpen = NULL;
onShow = NULL;
onHide = NULL;
onMove = NULL;
onResize = NULL;
onActivate = NULL;
onDeactivate = NULL;
accel = gtk_accel_group_new();
}
void gMainWindow::initWindow()
{
//resize(200,150);
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
if (!isTopLevel())
{
g_signal_connect(G_OBJECT(border), "show", G_CALLBACK(cb_show), (gpointer)this);
g_signal_connect(G_OBJECT(border), "configure-event", G_CALLBACK(cb_configure), (gpointer)this);
g_signal_connect_after(G_OBJECT(border), "map-event", G_CALLBACK(cb_open), (gpointer)this);
g_signal_connect(G_OBJECT(border),"show",G_CALLBACK(cb_show),(gpointer)this);
g_signal_connect(G_OBJECT(border),"hide",G_CALLBACK(cb_hide),(gpointer)this);
//g_signal_connect_after(G_OBJECT(border), "size-allocate", G_CALLBACK(cb_configure), (gpointer)this);
[DEVELOPMENT ENVIRONMENT] * NEW: Store the component version inside the .component files for component projects. * NEW: Package dependencies on component use the previous version stored in the .component file if it is available. Otherwise the current Gambas interpreter version is used. * BUG: Do not increment version release if the packager wizard is cancelled. * NEW: Package dependencies on component use the previous version stored in the .component file if it is available. Otherwise the current Gambas interpreter version is used. * NEW: The package wizard remembers the last directory used for storing packages. * BUG: The default directory where packages are stored is the home directory now. * BUG: Fix the signature display routine that sometimes underlined incorrectly. * BUG: Use version program at each project configuration write. * NEW: A "paste special" function in the code editor, that allows to insert plain text or HTML text from the clipboard, and can comment it, quote it as a Gambas string, or transform it into PRINT instructions. * BUG: Some fix related to the now immediate invalidity of deleted forms. [SCRIPTER] * NEW: Support for gambas server pages! * NEW: Server page are now run by a program named 'gbw2', which is just a symbolic link to 'gbs2'. [GB.GTK] * BUG: Window.Picture property now works correctly when the window is embedded inside a container. * BUG: Embedded windows having a background picture are now correctly updated when they are resized. * BUG: Correctly handle a form close or destroy during an event handler. * BUG: The combo-box behaves now like the qt one. Its first item is always selected at startup. * NEW: Now deleted forms become immediately invalid. [GB.QT] * BUG: Clipboard.Paste() now returns an UTF-8 string. * BUG: Correctly handle a form close or destroy during an event handler. * BUG: Checking if the application must quit is deferred, so that closing a form and opeing another one keeps the application running. * NEW: Now deleted forms become immediately invalid. [GB.QT.EXT] * BUG: Fix the Editor drawing while scrolling. * BUG: Fix conversion from cursor position to text column in Editor. * BUG: Fix the Editor drawing when it has been scrolled to the right. * BUG: Don't paste in Editor if there is nothing to paste. git-svn-id: svn://localhost/gambas/trunk@1605 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-09-26 02:25:29 +00:00
g_signal_connect(G_OBJECT(widget), "expose-event", G_CALLBACK(cb_expose), (gpointer)this);
}
else
{
//g_signal_connect(G_OBJECT(border),"size-request",G_CALLBACK(cb_realize),(gpointer)this);
g_signal_connect(G_OBJECT(border), "show",G_CALLBACK(cb_show),(gpointer)this);
g_signal_connect(G_OBJECT(border), "hide",G_CALLBACK(cb_hide),(gpointer)this);
g_signal_connect(G_OBJECT(border), "configure-event",G_CALLBACK(cb_configure),(gpointer)this);
g_signal_connect(G_OBJECT(border), "delete-event",G_CALLBACK(win_close),(gpointer)this);
g_signal_connect(G_OBJECT(border), "window-state-event",G_CALLBACK(win_frame),(gpointer)this);
[DEVELOPMENT ENVIRONMENT] * NEW: Store the component version inside the .component files for component projects. * NEW: Package dependencies on component use the previous version stored in the .component file if it is available. Otherwise the current Gambas interpreter version is used. * BUG: Do not increment version release if the packager wizard is cancelled. * NEW: Package dependencies on component use the previous version stored in the .component file if it is available. Otherwise the current Gambas interpreter version is used. * NEW: The package wizard remembers the last directory used for storing packages. * BUG: The default directory where packages are stored is the home directory now. * BUG: Fix the signature display routine that sometimes underlined incorrectly. * BUG: Use version program at each project configuration write. * NEW: A "paste special" function in the code editor, that allows to insert plain text or HTML text from the clipboard, and can comment it, quote it as a Gambas string, or transform it into PRINT instructions. * BUG: Some fix related to the now immediate invalidity of deleted forms. [SCRIPTER] * NEW: Support for gambas server pages! * NEW: Server page are now run by a program named 'gbw2', which is just a symbolic link to 'gbs2'. [GB.GTK] * BUG: Window.Picture property now works correctly when the window is embedded inside a container. * BUG: Embedded windows having a background picture are now correctly updated when they are resized. * BUG: Correctly handle a form close or destroy during an event handler. * BUG: The combo-box behaves now like the qt one. Its first item is always selected at startup. * NEW: Now deleted forms become immediately invalid. [GB.QT] * BUG: Clipboard.Paste() now returns an UTF-8 string. * BUG: Correctly handle a form close or destroy during an event handler. * BUG: Checking if the application must quit is deferred, so that closing a form and opeing another one keeps the application running. * NEW: Now deleted forms become immediately invalid. [GB.QT.EXT] * BUG: Fix the Editor drawing while scrolling. * BUG: Fix conversion from cursor position to text column in Editor. * BUG: Fix the Editor drawing when it has been scrolled to the right. * BUG: Don't paste in Editor if there is nothing to paste. git-svn-id: svn://localhost/gambas/trunk@1605 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-09-26 02:25:29 +00:00
gtk_widget_add_events(widget,GDK_BUTTON_MOTION_MASK);
g_signal_connect(G_OBJECT(widget), "expose-event", G_CALLBACK(cb_expose), (gpointer)this);
}
//GTK_WIDGET_SET_FLAGS (widget, GTK_CAN_FOCUS);
[DEVELOPMENT ENVIRONMENT] * BUG: Use TextEdit.RichText insted of TextEdit.Text. * BUG: END SUB can be the end of a method. The class analyze now takes   that into account. [HELP] * BUG: Fixed the generated treeview. [COMPILER] * OPT: The NOT operator used just at the beginning of a conditional expression is optimized. Consequently, an expression like 'IF NOT 2' is now equivalent to 'IF 2 = 0' and not to 'IF (NOT 2) <> 0' as before. In other words, the boolean conversion is now done before the NOT, and not after. The following instructions are concerned: IF, WHILE, UNTIL. * NEW: BYREF is new keyword that is a more readable synonymous of '@'. [GB.DB.FORM] * BUG: Correctly manage data controls inside TabStrip-like containers. * BUG: Setting the focus on a non-initialized DataControl does not raise an error anymore. [GB.GTK] * BUG: HSplitter.Layout and VSplitter.Layout now work correctly. It is a list of children widths, hidden children having a zero width. * BUG: Window arrangement is done before the Open event is raised, as in gb.qt. * BUG: Keyboard, focus and mouse events now work correctly on Window and DrawingArea controls. [GB.QT] * BUG: HSplitter.Layout and VSplitter.Layout now work correctly. It is a list of children widths, hidden children having a zero width. * BUG: Many warning fixes. * BUG: Now the Control.Visible property works like in gb.gtk, i.e. it returns if the control was not explicitely hidden. git-svn-id: svn://localhost/gambas/trunk@1060 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-02-06 00:25:48 +00:00
//gtk_widget_add_events(widget, GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK);
/* GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK
| GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
| GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_POINTER_MOTION_MASK);*/
gtk_window_add_accel_group(GTK_WINDOW(topLevel()->border), accel);
[DEVELOPMENT ENVIRONMENT] * NEW: Store the component version inside the .component files for component projects. * NEW: Package dependencies on component use the previous version stored in the .component file if it is available. Otherwise the current Gambas interpreter version is used. * BUG: Do not increment version release if the packager wizard is cancelled. * NEW: Package dependencies on component use the previous version stored in the .component file if it is available. Otherwise the current Gambas interpreter version is used. * NEW: The package wizard remembers the last directory used for storing packages. * BUG: The default directory where packages are stored is the home directory now. * BUG: Fix the signature display routine that sometimes underlined incorrectly. * BUG: Use version program at each project configuration write. * NEW: A "paste special" function in the code editor, that allows to insert plain text or HTML text from the clipboard, and can comment it, quote it as a Gambas string, or transform it into PRINT instructions. * BUG: Some fix related to the now immediate invalidity of deleted forms. [SCRIPTER] * NEW: Support for gambas server pages! * NEW: Server page are now run by a program named 'gbw2', which is just a symbolic link to 'gbs2'. [GB.GTK] * BUG: Window.Picture property now works correctly when the window is embedded inside a container. * BUG: Embedded windows having a background picture are now correctly updated when they are resized. * BUG: Correctly handle a form close or destroy during an event handler. * BUG: The combo-box behaves now like the qt one. Its first item is always selected at startup. * NEW: Now deleted forms become immediately invalid. [GB.QT] * BUG: Clipboard.Paste() now returns an UTF-8 string. * BUG: Correctly handle a form close or destroy during an event handler. * BUG: Checking if the application must quit is deferred, so that closing a form and opeing another one keeps the application running. * NEW: Now deleted forms become immediately invalid. [GB.QT.EXT] * BUG: Fix the Editor drawing while scrolling. * BUG: Fix conversion from cursor position to text column in Editor. * BUG: Fix the Editor drawing when it has been scrolled to the right. * BUG: Don't paste in Editor if there is nothing to paste. git-svn-id: svn://localhost/gambas/trunk@1605 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-09-26 02:25:29 +00:00
have_cursor = true; //parent() == 0 && !_xembed;
}
gMainWindow::gMainWindow(int plug) : gContainer(NULL)
{
initialize();
g_typ = Type_gMainWindow;
windows = g_list_append(windows, (gpointer)this);
_xembed = plug != 0;
if (_xembed)
border = gtk_plug_new(plug);
else
border = gtk_window_new(GTK_WINDOW_TOPLEVEL);
widget = gtk_layout_new(0,0);
realize(false);
[DEVELOPMENT ENVIRONMENT] * BUG: Use TextEdit.RichText insted of TextEdit.Text. * BUG: END SUB can be the end of a method. The class analyze now takes   that into account. [HELP] * BUG: Fixed the generated treeview. [COMPILER] * OPT: The NOT operator used just at the beginning of a conditional expression is optimized. Consequently, an expression like 'IF NOT 2' is now equivalent to 'IF 2 = 0' and not to 'IF (NOT 2) <> 0' as before. In other words, the boolean conversion is now done before the NOT, and not after. The following instructions are concerned: IF, WHILE, UNTIL. * NEW: BYREF is new keyword that is a more readable synonymous of '@'. [GB.DB.FORM] * BUG: Correctly manage data controls inside TabStrip-like containers. * BUG: Setting the focus on a non-initialized DataControl does not raise an error anymore. [GB.GTK] * BUG: HSplitter.Layout and VSplitter.Layout now work correctly. It is a list of children widths, hidden children having a zero width. * BUG: Window arrangement is done before the Open event is raised, as in gb.qt. * BUG: Keyboard, focus and mouse events now work correctly on Window and DrawingArea controls. [GB.QT] * BUG: HSplitter.Layout and VSplitter.Layout now work correctly. It is a list of children widths, hidden children having a zero width. * BUG: Many warning fixes. * BUG: Now the Control.Visible property works like in gb.gtk, i.e. it returns if the control was not explicitely hidden. git-svn-id: svn://localhost/gambas/trunk@1060 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-02-06 00:25:48 +00:00
initWindow();
[DEVELOPMENT ENVIRONMENT] * BUG: Use TextEdit.RichText insted of TextEdit.Text. * BUG: END SUB can be the end of a method. The class analyze now takes   that into account. [HELP] * BUG: Fixed the generated treeview. [COMPILER] * OPT: The NOT operator used just at the beginning of a conditional expression is optimized. Consequently, an expression like 'IF NOT 2' is now equivalent to 'IF 2 = 0' and not to 'IF (NOT 2) <> 0' as before. In other words, the boolean conversion is now done before the NOT, and not after. The following instructions are concerned: IF, WHILE, UNTIL. * NEW: BYREF is new keyword that is a more readable synonymous of '@'. [GB.DB.FORM] * BUG: Correctly manage data controls inside TabStrip-like containers. * BUG: Setting the focus on a non-initialized DataControl does not raise an error anymore. [GB.GTK] * BUG: HSplitter.Layout and VSplitter.Layout now work correctly. It is a list of children widths, hidden children having a zero width. * BUG: Window arrangement is done before the Open event is raised, as in gb.qt. * BUG: Keyboard, focus and mouse events now work correctly on Window and DrawingArea controls. [GB.QT] * BUG: HSplitter.Layout and VSplitter.Layout now work correctly. It is a list of children widths, hidden children having a zero width. * BUG: Many warning fixes. * BUG: Now the Control.Visible property works like in gb.gtk, i.e. it returns if the control was not explicitely hidden. git-svn-id: svn://localhost/gambas/trunk@1060 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-02-06 00:25:48 +00:00
gtk_widget_realize(border);
gtk_widget_show(widget);
gtk_widget_set_size_request(border, 4, 4);
}
gMainWindow::gMainWindow(gContainer *par) : gContainer(par)
{
initialize();
g_typ = Type_gMainWindow;
[DEVELOPMENT ENVIRONMENT] * NEW: Store the component version inside the .component files for component projects. * NEW: Package dependencies on component use the previous version stored in the .component file if it is available. Otherwise the current Gambas interpreter version is used. * BUG: Do not increment version release if the packager wizard is cancelled. * NEW: Package dependencies on component use the previous version stored in the .component file if it is available. Otherwise the current Gambas interpreter version is used. * NEW: The package wizard remembers the last directory used for storing packages. * BUG: The default directory where packages are stored is the home directory now. * BUG: Fix the signature display routine that sometimes underlined incorrectly. * BUG: Use version program at each project configuration write. * NEW: A "paste special" function in the code editor, that allows to insert plain text or HTML text from the clipboard, and can comment it, quote it as a Gambas string, or transform it into PRINT instructions. * BUG: Some fix related to the now immediate invalidity of deleted forms. [SCRIPTER] * NEW: Support for gambas server pages! * NEW: Server page are now run by a program named 'gbw2', which is just a symbolic link to 'gbs2'. [GB.GTK] * BUG: Window.Picture property now works correctly when the window is embedded inside a container. * BUG: Embedded windows having a background picture are now correctly updated when they are resized. * BUG: Correctly handle a form close or destroy during an event handler. * BUG: The combo-box behaves now like the qt one. Its first item is always selected at startup. * NEW: Now deleted forms become immediately invalid. [GB.QT] * BUG: Clipboard.Paste() now returns an UTF-8 string. * BUG: Correctly handle a form close or destroy during an event handler. * BUG: Checking if the application must quit is deferred, so that closing a form and opeing another one keeps the application running. * NEW: Now deleted forms become immediately invalid. [GB.QT.EXT] * BUG: Fix the Editor drawing while scrolling. * BUG: Fix conversion from cursor position to text column in Editor. * BUG: Fix the Editor drawing when it has been scrolled to the right. * BUG: Don't paste in Editor if there is nothing to paste. git-svn-id: svn://localhost/gambas/trunk@1605 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-09-26 02:25:29 +00:00
border = gtk_event_box_new();
widget = gtk_layout_new(0,0);
realize(false);
initWindow();
}
gMainWindow::~gMainWindow()
{
//fprintf(stderr, "delete window %p %s\n", this, name());
if (opened)
{
emit(SIGNAL(onClose));
opened = false;
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
if (GTK_IS_WINDOW(border) && modal())
gApplication::exitLoop(this);
}
if (_next_timer)
g_source_remove(_next_timer);
gPicture::assign(&_picture);
gPicture::assign(&_icon);
if (_title) g_free(_title);
g_object_unref(accel);
if (_background) g_object_unref(_background);
if (_style) g_object_unref(_style);
windows = g_list_remove(windows, (gpointer)this);
}
bool gMainWindow::getSticky()
{
return sticky;
}
int gMainWindow::getStacking()
{
return stack;
}
void gMainWindow::setSticky(bool vl)
{
sticky=vl;
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
if (!isTopLevel()) return;
if (vl) gtk_window_stick(GTK_WINDOW(border));
else gtk_window_unstick(GTK_WINDOW(border));
}
void gMainWindow::setStacking(int vl)
{
stack=vl;
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
if (!isTopLevel()) return;
switch (vl)
{
case 0:
gtk_window_set_keep_below(GTK_WINDOW(border),FALSE);
gtk_window_set_keep_above(GTK_WINDOW(border),FALSE);
break;
case 1:
gtk_window_set_keep_below(GTK_WINDOW(border),FALSE);
gtk_window_set_keep_above(GTK_WINDOW(border),TRUE);
break;
case 2:
gtk_window_set_keep_above(GTK_WINDOW(border),FALSE);
gtk_window_set_keep_below(GTK_WINDOW(border),TRUE);
break;
}
}
void gMainWindow::setRealBackground(gColor color)
{
if (!_picture)
gControl::setRealBackground(color);
}
void gMainWindow::move(int x, int y)
{
if (isTopLevel())
{
if (x == bufX && y == bufY)
return;
bufX = x;
bufY = y;
gtk_window_move(GTK_WINDOW(border), x, y);
}
else
{
gContainer::move(x,y);
}
}
void gMainWindow::resize(int w, int h)
{
if (isTopLevel())
{
if (w == bufW && h == bufH)
return;
_resized=true;
bufW = w;
bufH = h;
//gdk_window_enable_synchronized_configure (border->window);
if (w < 1 || h < 1)
{
if (visible)
gtk_widget_hide(border);
}
else
{
if (gtk_window_get_resizable(GTK_WINDOW(border)))
gtk_window_resize(GTK_WINDOW(border),w,h);
else
gtk_widget_set_size_request(border, w, h);
if (visible)
gtk_widget_show(border);
}
}
else
{
//fprintf(stderr, "resize %p -> (%d %d) (%d %d)\n", this, bufW, bufH, w, h);
gContainer::resize(w, h);
}
}
void gMainWindow::emitOpen()
{
if (!opened)
{
//fprintf(stderr, "emit Open: %p (%d %d)\n", this, width(), height());
opened = true;
gtk_widget_realize(border);
performArrange();
emit(SIGNAL(onOpen));
if (opened)
{
//fprintf(stderr, "emit Move & Resize: %p\n", this);
emit(SIGNAL(onMove));
emit(SIGNAL(onResize));
}
}
}
void gMainWindow::afterShow()
{
if (_activate)
{
gtk_window_present(GTK_WINDOW(border));
_activate = false;
}
}
void gMainWindow::setVisible(bool vl)
{
[CONFIGURATION] * BUG: Libraries and include files are automatically searched inside 64 bits specific directories. [DEVELOPMENT ENVIRONMENT] * NEW: Automatically convert old Border property to the new Border and Resizable properties. * BUG: The "Theme" tab of the option dialog is correctly initialized the first time Gambas is run. * BUG: Going to a non-existing line number in the editor does not crash the IDE anymore. * NEW: The IDE forms now use the new Border, Resizable and Type properties of the Window class. [COMPILER] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.EVAL] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.GTK] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. [GB.QT] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. git-svn-id: svn://localhost/gambas/trunk@1321 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-04-18 23:43:38 +00:00
gMainWindow *active;
if (vl)
{
emitOpen();
if (!opened)
return;
if (isTopLevel() && !_xembed)
{
//fprintf(stderr, "adding window %p to group %p\n", this, group);
gtk_window_group_add_window(gApplication::currentGroup(), GTK_WINDOW(border));
}
_not_spontaneous = !visible;
visible = true;
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
_hidden = false;
if (isTopLevel())
{
if (!_title || !*_title)
gtk_window_set_title(GTK_WINDOW(border), gApplication::defaultTitle());
[CONFIGURATION] * BUG: Libraries and include files are automatically searched inside 64 bits specific directories. [DEVELOPMENT ENVIRONMENT] * NEW: Automatically convert old Border property to the new Border and Resizable properties. * BUG: The "Theme" tab of the option dialog is correctly initialized the first time Gambas is run. * BUG: Going to a non-existing line number in the editor does not crash the IDE anymore. * NEW: The IDE forms now use the new Border, Resizable and Type properties of the Window class. [COMPILER] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.EVAL] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.GTK] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. [GB.QT] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. git-svn-id: svn://localhost/gambas/trunk@1321 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-04-18 23:43:38 +00:00
active = gDesktop::activeWindow();
if (active && active != this)
gtk_window_set_transient_for(GTK_WINDOW(border), GTK_WINDOW(active->border));
gtk_window_move(GTK_WINDOW(border), bufX, bufY);
gtk_window_present(GTK_WINDOW(border));
}
else
{
gtk_widget_show(border);
parent()->performArrange();
}
[DEVELOPMENT ENVIRONMENT] * NEW: Store the component version inside the .component files for component projects. * NEW: Package dependencies on component use the previous version stored in the .component file if it is available. Otherwise the current Gambas interpreter version is used. * BUG: Do not increment version release if the packager wizard is cancelled. * NEW: Package dependencies on component use the previous version stored in the .component file if it is available. Otherwise the current Gambas interpreter version is used. * NEW: The package wizard remembers the last directory used for storing packages. * BUG: The default directory where packages are stored is the home directory now. * BUG: Fix the signature display routine that sometimes underlined incorrectly. * BUG: Use version program at each project configuration write. * NEW: A "paste special" function in the code editor, that allows to insert plain text or HTML text from the clipboard, and can comment it, quote it as a Gambas string, or transform it into PRINT instructions. * BUG: Some fix related to the now immediate invalidity of deleted forms. [SCRIPTER] * NEW: Support for gambas server pages! * NEW: Server page are now run by a program named 'gbw2', which is just a symbolic link to 'gbs2'. [GB.GTK] * BUG: Window.Picture property now works correctly when the window is embedded inside a container. * BUG: Embedded windows having a background picture are now correctly updated when they are resized. * BUG: Correctly handle a form close or destroy during an event handler. * BUG: The combo-box behaves now like the qt one. Its first item is always selected at startup. * NEW: Now deleted forms become immediately invalid. [GB.QT] * BUG: Clipboard.Paste() now returns an UTF-8 string. * BUG: Correctly handle a form close or destroy during an event handler. * BUG: Checking if the application must quit is deferred, so that closing a form and opeing another one keeps the application running. * NEW: Now deleted forms become immediately invalid. [GB.QT.EXT] * BUG: Fix the Editor drawing while scrolling. * BUG: Fix conversion from cursor position to text column in Editor. * BUG: Fix the Editor drawing when it has been scrolled to the right. * BUG: Don't paste in Editor if there is nothing to paste. git-svn-id: svn://localhost/gambas/trunk@1605 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-09-26 02:25:29 +00:00
drawMask();
if (focus)
{
[DEVELOPMENT ENVIRONMENT] * NEW: Store the component version inside the .component files for component projects. * NEW: Package dependencies on component use the previous version stored in the .component file if it is available. Otherwise the current Gambas interpreter version is used. * BUG: Do not increment version release if the packager wizard is cancelled. * NEW: Package dependencies on component use the previous version stored in the .component file if it is available. Otherwise the current Gambas interpreter version is used. * NEW: The package wizard remembers the last directory used for storing packages. * BUG: The default directory where packages are stored is the home directory now. * BUG: Fix the signature display routine that sometimes underlined incorrectly. * BUG: Use version program at each project configuration write. * NEW: A "paste special" function in the code editor, that allows to insert plain text or HTML text from the clipboard, and can comment it, quote it as a Gambas string, or transform it into PRINT instructions. * BUG: Some fix related to the now immediate invalidity of deleted forms. [SCRIPTER] * NEW: Support for gambas server pages! * NEW: Server page are now run by a program named 'gbw2', which is just a symbolic link to 'gbs2'. [GB.GTK] * BUG: Window.Picture property now works correctly when the window is embedded inside a container. * BUG: Embedded windows having a background picture are now correctly updated when they are resized. * BUG: Correctly handle a form close or destroy during an event handler. * BUG: The combo-box behaves now like the qt one. Its first item is always selected at startup. * NEW: Now deleted forms become immediately invalid. [GB.QT] * BUG: Clipboard.Paste() now returns an UTF-8 string. * BUG: Correctly handle a form close or destroy during an event handler. * BUG: Checking if the application must quit is deferred, so that closing a form and opeing another one keeps the application running. * NEW: Now deleted forms become immediately invalid. [GB.QT.EXT] * BUG: Fix the Editor drawing while scrolling. * BUG: Fix conversion from cursor position to text column in Editor. * BUG: Fix the Editor drawing when it has been scrolled to the right. * BUG: Don't paste in Editor if there is nothing to paste. git-svn-id: svn://localhost/gambas/trunk@1605 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-09-26 02:25:29 +00:00
//fprintf(stderr, "focus = %s\n", focus->name());
focus->setFocus();
focus = 0;
}
if (skipTaskBar())
_activate = true;
}
else
{
if (this == _active)
focus = gDesktop::activeControl();
_not_spontaneous = visible;
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
_hidden = true;
gControl::setVisible(false);
}
}
void gMainWindow::setMinimized(bool vl)
{
if (vl) gtk_window_iconify(GTK_WINDOW(border));
else gtk_window_deiconify(GTK_WINDOW(border));
}
void gMainWindow::setMaximized(bool vl)
{
if (vl) gtk_window_maximize(GTK_WINDOW(border));
else gtk_window_unmaximize(GTK_WINDOW(border));
}
void gMainWindow::setFullscreen(bool vl)
{
if (vl) gtk_window_fullscreen(GTK_WINDOW(border));
else gtk_window_unfullscreen(GTK_WINDOW(border));
}
bool gMainWindow::minimized()
{
return (bool)(gdk_window_get_state(border->window) & GDK_WINDOW_STATE_ICONIFIED);
}
bool gMainWindow::maximized()
{
return (bool)(gdk_window_get_state(border->window) & GDK_WINDOW_STATE_MAXIMIZED);
}
bool gMainWindow::fullscreen()
{
return (bool)(gdk_window_get_state(border->window) & GDK_WINDOW_STATE_FULLSCREEN);
}
void gMainWindow::center()
{
int myx,myy;
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
if (!isTopLevel()) return;
myx=(gDesktop::width()/2)-(width()/2);
myy=(gDesktop::height()/2)-(height()/2);
move(myx,myy);
}
bool gMainWindow::modal()
{
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
if (!isTopLevel()) return false;
return gtk_window_get_modal (GTK_WINDOW(border));
}
void gMainWindow::showModal()
{
gMainWindow *save;
if (!isTopLevel()) return;
if (modal()) return;
save = _current;
_current = this;
gtk_window_set_modal(GTK_WINDOW(border), true);
center();
//show();
//fprintf(stderr, "showModal: begin %p\n", this);
gApplication::enterLoop(this, true);
//fprintf(stderr, "showModal: end %p\n", this);
_current = save;
gtk_window_set_modal(GTK_WINDOW(border), false);
if (!persistent)
destroyNow();
else
hide();
}
void gMainWindow::raise()
{
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
if (!isTopLevel()) { gControl::raise(); return; }
gtk_window_present(GTK_WINDOW(border));
}
const char* gMainWindow::text()
{
return _title;
}
bool gMainWindow::skipTaskBar()
{
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
if (!isTopLevel())
return false;
else
return _skip_taskbar;
}
void gMainWindow::setText(const char *txt)
{
if (_title) g_free(_title);
_title = g_strdup(txt);
if (isTopLevel())
gtk_window_set_title(GTK_WINDOW(border), txt);
}
[CONFIGURATION] * BUG: Libraries and include files are automatically searched inside 64 bits specific directories. [DEVELOPMENT ENVIRONMENT] * NEW: Automatically convert old Border property to the new Border and Resizable properties. * BUG: The "Theme" tab of the option dialog is correctly initialized the first time Gambas is run. * BUG: Going to a non-existing line number in the editor does not crash the IDE anymore. * NEW: The IDE forms now use the new Border, Resizable and Type properties of the Window class. [COMPILER] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.EVAL] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.GTK] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. [GB.QT] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. git-svn-id: svn://localhost/gambas/trunk@1321 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-04-18 23:43:38 +00:00
bool gMainWindow::hasBorder()
{
return gtk_window_get_decorated(GTK_WINDOW(border));
}
bool gMainWindow::isResizable()
{
return gtk_window_get_resizable(GTK_WINDOW(border));
}
void gMainWindow::setBorder(bool b)
{
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
if (!isTopLevel())
[CONFIGURATION] * BUG: Libraries and include files are automatically searched inside 64 bits specific directories. [DEVELOPMENT ENVIRONMENT] * NEW: Automatically convert old Border property to the new Border and Resizable properties. * BUG: The "Theme" tab of the option dialog is correctly initialized the first time Gambas is run. * BUG: Going to a non-existing line number in the editor does not crash the IDE anymore. * NEW: The IDE forms now use the new Border, Resizable and Type properties of the Window class. [COMPILER] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.EVAL] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.GTK] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. [GB.QT] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. git-svn-id: svn://localhost/gambas/trunk@1321 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-04-18 23:43:38 +00:00
return;
[CONFIGURATION] * BUG: Libraries and include files are automatically searched inside 64 bits specific directories. [DEVELOPMENT ENVIRONMENT] * NEW: Automatically convert old Border property to the new Border and Resizable properties. * BUG: The "Theme" tab of the option dialog is correctly initialized the first time Gambas is run. * BUG: Going to a non-existing line number in the editor does not crash the IDE anymore. * NEW: The IDE forms now use the new Border, Resizable and Type properties of the Window class. [COMPILER] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.EVAL] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.GTK] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. [GB.QT] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. git-svn-id: svn://localhost/gambas/trunk@1321 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-04-18 23:43:38 +00:00
gtk_window_set_decorated(GTK_WINDOW(border), b);
}
[CONFIGURATION] * BUG: Libraries and include files are automatically searched inside 64 bits specific directories. [DEVELOPMENT ENVIRONMENT] * NEW: Automatically convert old Border property to the new Border and Resizable properties. * BUG: The "Theme" tab of the option dialog is correctly initialized the first time Gambas is run. * BUG: Going to a non-existing line number in the editor does not crash the IDE anymore. * NEW: The IDE forms now use the new Border, Resizable and Type properties of the Window class. [COMPILER] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.EVAL] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.GTK] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. [GB.QT] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. git-svn-id: svn://localhost/gambas/trunk@1321 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-04-18 23:43:38 +00:00
void gMainWindow::setResizable(bool b)
{
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
if (!isTopLevel())
[CONFIGURATION] * BUG: Libraries and include files are automatically searched inside 64 bits specific directories. [DEVELOPMENT ENVIRONMENT] * NEW: Automatically convert old Border property to the new Border and Resizable properties. * BUG: The "Theme" tab of the option dialog is correctly initialized the first time Gambas is run. * BUG: Going to a non-existing line number in the editor does not crash the IDE anymore. * NEW: The IDE forms now use the new Border, Resizable and Type properties of the Window class. [COMPILER] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.EVAL] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.GTK] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. [GB.QT] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. git-svn-id: svn://localhost/gambas/trunk@1321 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-04-18 23:43:38 +00:00
return;
if (b == isResizable())
return;
gtk_window_set_resizable(GTK_WINDOW(border), b);
if (b)
gtk_widget_set_size_request(border, 1, 1);
else
gtk_widget_set_size_request(border, bufW, bufH);
}
[CONFIGURATION] * BUG: Libraries and include files are automatically searched inside 64 bits specific directories. [DEVELOPMENT ENVIRONMENT] * NEW: Automatically convert old Border property to the new Border and Resizable properties. * BUG: The "Theme" tab of the option dialog is correctly initialized the first time Gambas is run. * BUG: Going to a non-existing line number in the editor does not crash the IDE anymore. * NEW: The IDE forms now use the new Border, Resizable and Type properties of the Window class. [COMPILER] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.EVAL] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.GTK] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. [GB.QT] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. git-svn-id: svn://localhost/gambas/trunk@1321 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-04-18 23:43:38 +00:00
void gMainWindow::setSkipTaskBar(bool b)
{
_skip_taskbar = b;
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
if (!isTopLevel()) return;
gtk_window_set_skip_taskbar_hint (GTK_WINDOW(border), b);
}
/*gPicture* gMainWindow::icon()
{
GdkPixbuf *buf;
gPicture *pic;
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
if (!isTopLevel()) return NULL;
buf=gtk_window_get_icon(GTK_WINDOW(border));
if (!buf) return NULL;
pic=gPicture::fromPixbuf(buf);
return pic;
}*/
void gMainWindow::setIcon(gPicture *pic)
{
gPicture::assign(&_icon, pic);
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
if (!isTopLevel()) return;
gtk_window_set_icon(GTK_WINDOW(border), pic ? pic->getPixbuf() : NULL);
}
bool gMainWindow::topOnly()
{
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
if (!isTopLevel()) return false;
return top_only;
}
void gMainWindow::setTopOnly(bool vl)
{
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
if (!isTopLevel()) return;
gtk_window_set_keep_above (GTK_WINDOW(border),vl);
top_only=vl;
}
void gMainWindow::setMask(bool vl)
{
if (_mask == vl)
return;
_mask = vl;
drawMask();
}
void gMainWindow::setPicture(gPicture *pic)
{
gPicture::assign(&_picture, pic);
drawMask();
}
void gMainWindow::remap()
{
if (!isVisible())
return;
gtk_widget_unmap(border);
gtk_widget_map(border);
if (_skip_taskbar) { setSkipTaskBar(false); setSkipTaskBar(true); }
if (top_only) { setTopOnly(false); setTopOnly(true); }
if (sticky) { setSticky(false); setSticky(true); }
if (stack) { setStacking(0); setStacking(stack); }
X11_set_window_type(handle(), _type);
}
void gMainWindow::drawMask()
{
GdkBitmap *mask;
GdkPixmap *back;
bool do_remap = false;
/*if (win_style)
{
g_object_unref(win_style);
win_style = NULL;
}*/
/*if (_picture)
{
back = _picture->getPixmap();
g_object_ref(back);
win_style = gtk_style_copy(widget->style);
win_style->bg_pixmap[GTK_STATE_NORMAL] = back;
gtk_widget_set_style(widget, win_style);
//gdk_window_invalidate_rect(border->window,NULL,true);
}
else
{
gtk_widget_set_style(widget, NULL);
}*/
if (!isVisible())
return;
//if (_background)
// g_object_unref(_background);
mask = (_mask && _picture) ? _picture->getMask() : NULL;
do_remap = !mask && _masked;
#ifdef GDK_WINDOWING_X11
XShapeCombineMask(GDK_WINDOW_XDISPLAY(border->window), GDK_WINDOW_XID(border->window), ShapeBounding, 0, 0,
mask ? GDK_PIXMAP_XID(mask) : None, ShapeSet);
#else
//gdk_window_shape_combine_mask(border->window, mask, 0, 0);
#endif
back = _picture ? _picture->getPixmap() : NULL;
gtk_widget_set_double_buffered(border, back == NULL);
gtk_widget_set_double_buffered(widget, back == NULL);
if (back)
{
[DEVELOPMENT ENVIRONMENT] * NEW: Store the component version inside the .component files for component projects. * NEW: Package dependencies on component use the previous version stored in the .component file if it is available. Otherwise the current Gambas interpreter version is used. * BUG: Do not increment version release if the packager wizard is cancelled. * NEW: Package dependencies on component use the previous version stored in the .component file if it is available. Otherwise the current Gambas interpreter version is used. * NEW: The package wizard remembers the last directory used for storing packages. * BUG: The default directory where packages are stored is the home directory now. * BUG: Fix the signature display routine that sometimes underlined incorrectly. * BUG: Use version program at each project configuration write. * NEW: A "paste special" function in the code editor, that allows to insert plain text or HTML text from the clipboard, and can comment it, quote it as a Gambas string, or transform it into PRINT instructions. * BUG: Some fix related to the now immediate invalidity of deleted forms. [SCRIPTER] * NEW: Support for gambas server pages! * NEW: Server page are now run by a program named 'gbw2', which is just a symbolic link to 'gbs2'. [GB.GTK] * BUG: Window.Picture property now works correctly when the window is embedded inside a container. * BUG: Embedded windows having a background picture are now correctly updated when they are resized. * BUG: Correctly handle a form close or destroy during an event handler. * BUG: The combo-box behaves now like the qt one. Its first item is always selected at startup. * NEW: Now deleted forms become immediately invalid. [GB.QT] * BUG: Clipboard.Paste() now returns an UTF-8 string. * BUG: Correctly handle a form close or destroy during an event handler. * BUG: Checking if the application must quit is deferred, so that closing a form and opeing another one keeps the application running. * NEW: Now deleted forms become immediately invalid. [GB.QT.EXT] * BUG: Fix the Editor drawing while scrolling. * BUG: Fix conversion from cursor position to text column in Editor. * BUG: Fix the Editor drawing when it has been scrolled to the right. * BUG: Don't paste in Editor if there is nothing to paste. git-svn-id: svn://localhost/gambas/trunk@1605 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-09-26 02:25:29 +00:00
gtk_widget_realize(border);
gtk_widget_realize(widget);
gdk_window_set_back_pixmap(border->window, back, FALSE);
gdk_window_set_back_pixmap(GTK_LAYOUT(widget)->bin_window, back, FALSE);
gdk_window_clear(border->window);
gdk_window_clear(GTK_LAYOUT(widget)->bin_window);
gtk_widget_set_app_paintable(border, true);
gtk_widget_set_app_paintable(widget, true);
}
else
{
setRealBackground(background());
}
if (_background)
g_object_unref(_background);
_background = back;
if (_background)
g_object_ref(_background);
_masked = mask != NULL;
if (do_remap)
remap();
else
{
if (!_skip_taskbar)
{
setSkipTaskBar(true);
setSkipTaskBar(false);
}
}
//gtk_widget_queue_draw(border);
#if 0
GdkBitmap *map=NULL;
GdkPixmap *pix=NULL;
GdkColor black;
gint pw,ph;
GdkPixbuf *buf_mask = _picture ? _picture->getPixbuf() : NULL;
if (win_style) {
g_object_unref(win_style);
win_style=NULL;
}
if (buf_mask)
{
pw=gdk_pixbuf_get_width(buf_mask);
ph=gdk_pixbuf_get_height(buf_mask);
map=gdk_pixmap_new(NULL,pw,ph,1);
gdk_pixbuf_render_threshold_alpha(buf_mask,map,0,0,0,0,pw,ph,128);
pix=gdk_pixmap_new(border->window,pw,ph,-1);
GdkGC* gc=gdk_gc_new(border->window);
fill_gdk_color(&black,0);
gdk_gc_set_foreground (gc,&black);
gdk_gc_set_background (gc,&black);
gdk_draw_rectangle(pix,gc,true,0,0,pw,ph);
gdk_draw_pixbuf(pix,gc,buf_mask,0,0,0,0,pw,ph,GDK_RGB_DITHER_MAX,0,0);
g_object_unref(G_OBJECT(gc));
}
if (buf_mask && _mask) gtk_widget_shape_combine_mask(border,map,0,0);
else gtk_widget_shape_combine_mask(border,NULL,0,0);
if (map)
{
win_style=gtk_style_copy(widget->style);
win_style->bg_pixmap[GTK_STATE_NORMAL]=pix;
gtk_widget_set_style(widget,win_style);
gdk_window_invalidate_rect( border->window,NULL,true);
g_object_unref(G_OBJECT(map));
}
else
{
gtk_widget_set_style(widget,NULL);
if (border->window) //GTK_WIDGET_REALIZED(widget))
{
gtk_widget_reset_shapes(border);
gdk_window_invalidate_rect(border->window,NULL,true);
}
}
#endif
}
int gMainWindow::menuCount()
{
if (!menuBar) return 0;
return gMenu::winChildCount(this);
}
void gMainWindow::setPersistent(bool vl)
{
persistent = vl;
}
bool gMainWindow::doClose()
{
if (_closing)
return false;
if (opened)
{
if (modal() && !gApplication::hasLoop(this))
return true;
_closing = true;
if (onClose)
{
if (!onClose(this))
opened = false;
}
else
opened = false;
_closing = false;
if (modal())
gApplication::exitLoop(this);
}
if (!opened) // && !modal())
{
if (!modal())
{
if (persistent)
hide();
else
destroy();
}
return false;
}
else
return opened;
}
bool gMainWindow::close()
{
return doClose();
}
void gMainWindow::reparent(gContainer *newpr, int x, int y)
{
GtkWidget *new_border;
int w, h;
gColor fg, bg;
if (_xembed)
return;
bg = background();
fg = foreground();
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
if (isTopLevel() && newpr)
{
gtk_window_remove_accel_group(GTK_WINDOW(topLevel()->border), accel);
new_border = gtk_event_box_new();
gtk_widget_reparent(widget, new_border);
[DEVELOPMENT ENVIRONMENT] * BUG: The button that switches between form and class editor is not shown anymore when a module or a class is edited. [GB.GTK] * BUG: Font management was redesigned. It does not leak memory anymore, and now behaves like in gb.qt. * BUG: Tristate CheckBox controls now work as expected. * BUG: Destroy pending deleted controls before entering the event loop, to avoid some memory leaks if the event loop is immediately aborted. * BUG: Detach destroyed controls from their event listener, as in gb.qt. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. [GB.QT] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Showing a tray icon does not eat focus events anymore. * NEW: Top-level menus with a void Text property are not shown anymore. [GB.QT4] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Shortcut management was fixed. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. git-svn-id: svn://localhost/gambas/trunk@2034 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2009-06-22 11:16:34 +00:00
embedMenuBar(new_border);
_no_delete = true;
gtk_widget_destroy(border);
_no_delete = false;
border = new_border;
registerControl();
setParent(newpr);
connectParent();
borderSignals();
initWindow();
setBackground(bg);
setForeground(fg);
setFont(font());
[DEVELOPMENT ENVIRONMENT] * BUG: The button that switches between form and class editor is not shown anymore when a module or a class is edited. [GB.GTK] * BUG: Font management was redesigned. It does not leak memory anymore, and now behaves like in gb.qt. * BUG: Tristate CheckBox controls now work as expected. * BUG: Destroy pending deleted controls before entering the event loop, to avoid some memory leaks if the event loop is immediately aborted. * BUG: Detach destroyed controls from their event listener, as in gb.qt. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. [GB.QT] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Showing a tray icon does not eat focus events anymore. * NEW: Top-level menus with a void Text property are not shown anymore. [GB.QT4] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Shortcut management was fixed. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. git-svn-id: svn://localhost/gambas/trunk@2034 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2009-06-22 11:16:34 +00:00
checkMenuBar();
move(x, y);
gtk_widget_set_size_request(border, width(), height());
}
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
else if (!isTopLevel() && !newpr)
{
gtk_window_remove_accel_group(GTK_WINDOW(topLevel()->border), accel);
// TODO: test that
new_border = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_reparent(widget, new_border);
[DEVELOPMENT ENVIRONMENT] * BUG: The button that switches between form and class editor is not shown anymore when a module or a class is edited. [GB.GTK] * BUG: Font management was redesigned. It does not leak memory anymore, and now behaves like in gb.qt. * BUG: Tristate CheckBox controls now work as expected. * BUG: Destroy pending deleted controls before entering the event loop, to avoid some memory leaks if the event loop is immediately aborted. * BUG: Detach destroyed controls from their event listener, as in gb.qt. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. [GB.QT] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Showing a tray icon does not eat focus events anymore. * NEW: Top-level menus with a void Text property are not shown anymore. [GB.QT4] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Shortcut management was fixed. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. git-svn-id: svn://localhost/gambas/trunk@2034 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2009-06-22 11:16:34 +00:00
embedMenuBar(new_border);
_no_delete = true;
gtk_widget_destroy(border);
_no_delete = false;
border = new_border;
registerControl();
parent()->remove(this);
parent()->arrange();
setParent(NULL);
initWindow();
borderSignals();
setBackground(bg);
setForeground(fg);
setFont(font());
move(x, y);
w = width();
h = height();
bufW = bufH = -1;
resize(w, h);
}
else
gControl::reparent(newpr, x, y);
}
int gMainWindow::controlCount()
{
GList *list = gControl::controlList();
gControl *ctrl;
int n = 0;
while (list)
{
ctrl = (gControl *)list->data;
if (ctrl->window() == this)
n++;
list = g_list_next(list);
}
return n;
}
gControl *gMainWindow::getControl(char *name)
{
GList *list = gControl::controlList();
gControl *ctrl;
while (list)
{
ctrl = (gControl *)list->data;
if (ctrl->window() == this && !strcasecmp(ctrl->name(), name))
return ctrl;
list = g_list_next(list);
}
return NULL;
}
gControl *gMainWindow::getControl(int index)
{
GList *list = gControl::controlList();
gControl *ctrl;
int i = 0;
while (list)
{
ctrl = (gControl *)list->data;
if (ctrl->window() == this)
{
if (i == index)
return ctrl;
i++;
}
list = g_list_next(list);
}
return NULL;
}
int gMainWindow::clientX()
{
return 0;
}
int gMainWindow::containerX()
{
return 0;
}
int gMainWindow::clientY()
{
GtkRequisition req;
if (menuBar && GTK_WIDGET_VISIBLE(GTK_WIDGET(menuBar)))
{
gtk_widget_size_request(GTK_WIDGET(menuBar), &req);
return req.height;
}
return 0;
}
int gMainWindow::containerY()
{
return 0;
}
int gMainWindow::clientWidth()
{
return width();
}
[DEVELOPMENT ENVIRONMENT] * BUG: The button that switches between form and class editor is not shown anymore when a module or a class is edited. [GB.GTK] * BUG: Font management was redesigned. It does not leak memory anymore, and now behaves like in gb.qt. * BUG: Tristate CheckBox controls now work as expected. * BUG: Destroy pending deleted controls before entering the event loop, to avoid some memory leaks if the event loop is immediately aborted. * BUG: Detach destroyed controls from their event listener, as in gb.qt. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. [GB.QT] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Showing a tray icon does not eat focus events anymore. * NEW: Top-level menus with a void Text property are not shown anymore. [GB.QT4] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Shortcut management was fixed. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. git-svn-id: svn://localhost/gambas/trunk@2034 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2009-06-22 11:16:34 +00:00
int gMainWindow::menuBarHeight()
{
GtkRequisition req;
int h = 0;
[DEVELOPMENT ENVIRONMENT] * BUG: The button that switches between form and class editor is not shown anymore when a module or a class is edited. [GB.GTK] * BUG: Font management was redesigned. It does not leak memory anymore, and now behaves like in gb.qt. * BUG: Tristate CheckBox controls now work as expected. * BUG: Destroy pending deleted controls before entering the event loop, to avoid some memory leaks if the event loop is immediately aborted. * BUG: Detach destroyed controls from their event listener, as in gb.qt. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. [GB.QT] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Showing a tray icon does not eat focus events anymore. * NEW: Top-level menus with a void Text property are not shown anymore. [GB.QT4] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Shortcut management was fixed. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. git-svn-id: svn://localhost/gambas/trunk@2034 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2009-06-22 11:16:34 +00:00
if (menuBar)
{
gtk_widget_size_request(GTK_WIDGET(menuBar), &req);
h = req.height;
}
[DEVELOPMENT ENVIRONMENT] * BUG: The button that switches between form and class editor is not shown anymore when a module or a class is edited. [GB.GTK] * BUG: Font management was redesigned. It does not leak memory anymore, and now behaves like in gb.qt. * BUG: Tristate CheckBox controls now work as expected. * BUG: Destroy pending deleted controls before entering the event loop, to avoid some memory leaks if the event loop is immediately aborted. * BUG: Detach destroyed controls from their event listener, as in gb.qt. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. [GB.QT] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Showing a tray icon does not eat focus events anymore. * NEW: Top-level menus with a void Text property are not shown anymore. [GB.QT4] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Shortcut management was fixed. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. git-svn-id: svn://localhost/gambas/trunk@2034 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2009-06-22 11:16:34 +00:00
return h;
}
int gMainWindow::clientHeight()
{
if (isMenuBarVisible())
return height() - menuBarHeight();
else
return height();
}
void gMainWindow::setActiveWindow(gControl *control)
{
gMainWindow *window = control ? control->window() : NULL;
gMainWindow *old = _active;
if (window == _active)
return;
_active = window;
if (old)
old->emit(SIGNAL(old->onDeactivate));
if (window)
window->emit(SIGNAL(window->onActivate));
}
[CONFIGURATION] * BUG: Libraries and include files are automatically searched inside 64 bits specific directories. [DEVELOPMENT ENVIRONMENT] * NEW: Automatically convert old Border property to the new Border and Resizable properties. * BUG: The "Theme" tab of the option dialog is correctly initialized the first time Gambas is run. * BUG: Going to a non-existing line number in the editor does not crash the IDE anymore. * NEW: The IDE forms now use the new Border, Resizable and Type properties of the Window class. [COMPILER] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.EVAL] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.GTK] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. [GB.QT] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. git-svn-id: svn://localhost/gambas/trunk@1321 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-04-18 23:43:38 +00:00
#ifdef GDK_WINDOWING_X11
int gMainWindow::getType()
{
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
if (!isTopLevel())
[CONFIGURATION] * BUG: Libraries and include files are automatically searched inside 64 bits specific directories. [DEVELOPMENT ENVIRONMENT] * NEW: Automatically convert old Border property to the new Border and Resizable properties. * BUG: The "Theme" tab of the option dialog is correctly initialized the first time Gambas is run. * BUG: Going to a non-existing line number in the editor does not crash the IDE anymore. * NEW: The IDE forms now use the new Border, Resizable and Type properties of the Window class. [COMPILER] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.EVAL] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.GTK] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. [GB.QT] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. git-svn-id: svn://localhost/gambas/trunk@1321 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-04-18 23:43:38 +00:00
return 0;
return _type; //X11_get_window_type(handle());
[CONFIGURATION] * BUG: Libraries and include files are automatically searched inside 64 bits specific directories. [DEVELOPMENT ENVIRONMENT] * NEW: Automatically convert old Border property to the new Border and Resizable properties. * BUG: The "Theme" tab of the option dialog is correctly initialized the first time Gambas is run. * BUG: Going to a non-existing line number in the editor does not crash the IDE anymore. * NEW: The IDE forms now use the new Border, Resizable and Type properties of the Window class. [COMPILER] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.EVAL] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.GTK] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. [GB.QT] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. git-svn-id: svn://localhost/gambas/trunk@1321 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-04-18 23:43:38 +00:00
}
void gMainWindow::setType(int type)
{
[CONFIGURATION] * NEW: Upgrade libtool autoconf macros and libltdl sources to the 1.5.26 version. [DEVELOPMENT ENVIRONMENT] * BUG: Control and window dimensions can go up to 4096x4096 pixels. * BUG: When unchecking GUI components in a project, the edited forms are automatically closed. * BUG: Do not use the form icon on form class editors when refreshing the project. * BUG: In the icon editor, filling with a transparent color won't enter an infinite loop anymore. * BUG: Selecting the "Collection" word while debugging does not crash the IDE anymore. * NEW: Pressing Escape now closes a debugging window. * BUG: The 'Minimize on run' option works correctly now. [INTERPRETER] * BUG: SUPER now works inside overriden static methods. [GB.DB.ODBC] * BUG: Handle ODBC drivers that can return the number of records in a query better. [GB.DEBUG] * BUG: If there is an I/O error between a debugged process and the IDE, the process is aborted. * BUG: Evaluating a class name returns better information now. [GB.EVAL] * BUG: Highlight.Analyze correctly handle code lines having non ASCII characters inside. [GB.FORM] * BUG: The Balloon does not take the focus anymore. [GB.FORM.MDI] * NEW: Starting to enhance the Action class to provide shortcuts and toolbar configuration dialog. Does nothing at the moment! [GB.GTK] * BUG: Fix a leak in font objects management. * BUG: Picture.Load() yet loads an image, but internally converts it to a pixmap. It speeds up following draws based on this picture. * BUG: Startup forms hidden at design time are not shown automatically anymore. * NEW: The Action class is now shared with gb.qt by using a symbolic link. [GB.IMAGE.INFO] * NEW: New component to get information about an image file without having to fully load it. [GB.QT] * BUG: Disable automatic extra indent of Labels. * BUG: Startup forms hidden at design time are not shown automatically anymore. * BUG: Don't allow widgets to be destroyed while processing non-input events. git-svn-id: svn://localhost/gambas/trunk@1747 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-12-28 19:01:39 +00:00
if (!isTopLevel())
[CONFIGURATION] * BUG: Libraries and include files are automatically searched inside 64 bits specific directories. [DEVELOPMENT ENVIRONMENT] * NEW: Automatically convert old Border property to the new Border and Resizable properties. * BUG: The "Theme" tab of the option dialog is correctly initialized the first time Gambas is run. * BUG: Going to a non-existing line number in the editor does not crash the IDE anymore. * NEW: The IDE forms now use the new Border, Resizable and Type properties of the Window class. [COMPILER] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.EVAL] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.GTK] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. [GB.QT] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. git-svn-id: svn://localhost/gambas/trunk@1321 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-04-18 23:43:38 +00:00
return;
X11_set_window_type(handle(), type);
_type = type;
[CONFIGURATION] * BUG: Libraries and include files are automatically searched inside 64 bits specific directories. [DEVELOPMENT ENVIRONMENT] * NEW: Automatically convert old Border property to the new Border and Resizable properties. * BUG: The "Theme" tab of the option dialog is correctly initialized the first time Gambas is run. * BUG: Going to a non-existing line number in the editor does not crash the IDE anymore. * NEW: The IDE forms now use the new Border, Resizable and Type properties of the Window class. [COMPILER] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.EVAL] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.GTK] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. [GB.QT] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. git-svn-id: svn://localhost/gambas/trunk@1321 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-04-18 23:43:38 +00:00
}
#else
int gMainWindow::getType()
{
return 0;
}
[CONFIGURATION] * BUG: Libraries and include files are automatically searched inside 64 bits specific directories. [DEVELOPMENT ENVIRONMENT] * NEW: Automatically convert old Border property to the new Border and Resizable properties. * BUG: The "Theme" tab of the option dialog is correctly initialized the first time Gambas is run. * BUG: Going to a non-existing line number in the editor does not crash the IDE anymore. * NEW: The IDE forms now use the new Border, Resizable and Type properties of the Window class. [COMPILER] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.EVAL] * BUG: Do not print error messages on unexpected strings with newline inside. Just claim that an unexpected string has been encountered. [GB.GTK] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. [GB.QT] * NEW: The old Border property of the Window class has been replaced by a two boolean properties: Border and Resizable. * NEW: Window.Type is a new property to set the window manager type of a window: Normal, ToolBar, Splash... * NEW: The Window.ToolBox property has been removed. * NEW: A newly opened non-modal window stays automatically on top of the application main window. git-svn-id: svn://localhost/gambas/trunk@1321 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-04-18 23:43:38 +00:00
void gMainWindow::setType()
{
}
#endif
[DEVELOPMENT ENVIRONMENT] * BUG: The button that switches between form and class editor is not shown anymore when a module or a class is edited. [GB.GTK] * BUG: Font management was redesigned. It does not leak memory anymore, and now behaves like in gb.qt. * BUG: Tristate CheckBox controls now work as expected. * BUG: Destroy pending deleted controls before entering the event loop, to avoid some memory leaks if the event loop is immediately aborted. * BUG: Detach destroyed controls from their event listener, as in gb.qt. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. [GB.QT] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Showing a tray icon does not eat focus events anymore. * NEW: Top-level menus with a void Text property are not shown anymore. [GB.QT4] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Shortcut management was fixed. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. git-svn-id: svn://localhost/gambas/trunk@2034 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2009-06-22 11:16:34 +00:00
void gMainWindow::configure()
{
int h;
h = menuBarHeight();
if (isMenuBarVisible())
{
gtk_fixed_move(layout, GTK_WIDGET(menuBar), 0, 0);
gtk_widget_set_size_request(GTK_WIDGET(menuBar), width(), h);
gtk_fixed_move(layout, widget, 0, h);
gtk_widget_set_size_request(widget, width(), height() - h);
}
else
{
if (layout)
{
if (menuBar)
gtk_fixed_move(layout, GTK_WIDGET(menuBar), 0, -h);
gtk_fixed_move(layout, widget, 0, 0);
gtk_widget_set_size_request(widget, width(), height());
}
}
}
void gMainWindow::setMenuBarVisible(bool v)
{
[DEVELOPMENT ENVIRONMENT] * BUG: The button that switches between form and class editor is not shown anymore when a module or a class is edited. [GB.GTK] * BUG: Font management was redesigned. It does not leak memory anymore, and now behaves like in gb.qt. * BUG: Tristate CheckBox controls now work as expected. * BUG: Destroy pending deleted controls before entering the event loop, to avoid some memory leaks if the event loop is immediately aborted. * BUG: Detach destroyed controls from their event listener, as in gb.qt. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. [GB.QT] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Showing a tray icon does not eat focus events anymore. * NEW: Top-level menus with a void Text property are not shown anymore. [GB.QT4] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Shortcut management was fixed. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. git-svn-id: svn://localhost/gambas/trunk@2034 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2009-06-22 11:16:34 +00:00
_showMenuBar = v;
if (!menuBar)
return;
[DEVELOPMENT ENVIRONMENT] * BUG: The button that switches between form and class editor is not shown anymore when a module or a class is edited. [GB.GTK] * BUG: Font management was redesigned. It does not leak memory anymore, and now behaves like in gb.qt. * BUG: Tristate CheckBox controls now work as expected. * BUG: Destroy pending deleted controls before entering the event loop, to avoid some memory leaks if the event loop is immediately aborted. * BUG: Detach destroyed controls from their event listener, as in gb.qt. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. [GB.QT] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Showing a tray icon does not eat focus events anymore. * NEW: Top-level menus with a void Text property are not shown anymore. [GB.QT4] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Shortcut management was fixed. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. git-svn-id: svn://localhost/gambas/trunk@2034 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2009-06-22 11:16:34 +00:00
configure();
performArrange();
}
bool gMainWindow::isMenuBarVisible()
{
[DEVELOPMENT ENVIRONMENT] * BUG: The button that switches between form and class editor is not shown anymore when a module or a class is edited. [GB.GTK] * BUG: Font management was redesigned. It does not leak memory anymore, and now behaves like in gb.qt. * BUG: Tristate CheckBox controls now work as expected. * BUG: Destroy pending deleted controls before entering the event loop, to avoid some memory leaks if the event loop is immediately aborted. * BUG: Detach destroyed controls from their event listener, as in gb.qt. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. [GB.QT] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Showing a tray icon does not eat focus events anymore. * NEW: Top-level menus with a void Text property are not shown anymore. [GB.QT4] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Shortcut management was fixed. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. git-svn-id: svn://localhost/gambas/trunk@2034 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2009-06-22 11:16:34 +00:00
return menuBar && !_hideMenuBar && _showMenuBar; //|| (menuBar && GTK_WIDGET_MAPPED(GTK_WIDGET(menuBar)));
}
void gMainWindow::setFont(gFont *ft)
{
gContainer::setFont(ft);
gMenu::updateFont(this);
}
[DEVELOPMENT ENVIRONMENT] * BUG: The button that switches between form and class editor is not shown anymore when a module or a class is edited. [GB.GTK] * BUG: Font management was redesigned. It does not leak memory anymore, and now behaves like in gb.qt. * BUG: Tristate CheckBox controls now work as expected. * BUG: Destroy pending deleted controls before entering the event loop, to avoid some memory leaks if the event loop is immediately aborted. * BUG: Detach destroyed controls from their event listener, as in gb.qt. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. [GB.QT] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Showing a tray icon does not eat focus events anymore. * NEW: Top-level menus with a void Text property are not shown anymore. [GB.QT4] * BUG: Font properties are correctly inherited between containers and children controls. * BUG: Shortcut management was fixed. * BUG: Now menu shortcuts are active even if the menu bar is hidden. But the menu must be visible. To create an hidden active top-level menu, just set its Text property to NULL, but keep it visible. * NEW: Top-level menus with a void Text property are not shown anymore. * BUG: Showing and hiding top-level menu now work correctly. git-svn-id: svn://localhost/gambas/trunk@2034 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2009-06-22 11:16:34 +00:00
void gMainWindow::checkMenuBar()
{
int i;
gMenu *menu;
if (menuBar)
{
_hideMenuBar = true;
for (i = 0;; i++)
{
menu = gMenu::winChildMenu(this, i);
if (!menu)
break;
if (menu->isVisible() && !menu->isSeparator())
{
_hideMenuBar = false;
break;
}
}
}
configure();
}
void gMainWindow::embedMenuBar(GtkWidget *border)
{
if (menuBar)
{
// layout is automatically destructed ?
layout = GTK_FIXED(gtk_fixed_new());
g_object_ref(G_OBJECT(menuBar));
if (gtk_widget_get_parent(GTK_WIDGET(menuBar)))
gtk_container_remove(GTK_CONTAINER(gtk_widget_get_parent(GTK_WIDGET(menuBar))), GTK_WIDGET(menuBar));
gtk_fixed_put(layout, GTK_WIDGET(menuBar), 0, 0);
g_object_unref(G_OBJECT(menuBar));
gtk_widget_reparent(widget, GTK_WIDGET(layout));
gtk_container_add(GTK_CONTAINER(border), GTK_WIDGET(layout));
gtk_widget_show_all(GTK_WIDGET(layout));
//gtk_widget_show(GTK_WIDGET(par->menuBar));
set_gdk_fg_color(GTK_WIDGET(menuBar), foreground());
set_gdk_bg_color(GTK_WIDGET(menuBar), background());
//gtk_widget_modify_font(GTK_WIDGET(menuBar), font()->desc());
checkMenuBar();
}
}