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

168 lines
4.2 KiB
C
Raw Normal View History

/***************************************************************************
gmainwindow.h
(c) 2000-2009 Benoît Minisini <gambas@users.sourceforge.net>
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.
***************************************************************************/
#ifndef __GMAINWINDOW_H
#define __GMAINWINDOW_H
#include "gbutton.h"
class gMainWindow : public gContainer
{
public:
gMainWindow(int plug = 0);
gMainWindow(gContainer *parent);
~gMainWindow();
//"Properties"
[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 hasBorder();
bool isResizable();
int getType();
gPicture *icon() { return _icon; }
gPicture *picture() { return _picture; }
bool mask() { return _mask; }
int menuCount();
bool modal();
const char* text();
bool topOnly();
bool skipTaskBar();
bool minimized();
bool maximized();
bool fullscreen();
bool getSticky();
int getStacking();
bool isPersistent() { return persistent; }
bool isClosed() { return !opened; }
[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
bool isHidden() { return _hidden; }
int controlCount();
gControl *getControl(char *name);
gControl *getControl(int i);
[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 setBorder(bool b);
void setResizable(bool b);
void setType(int type);
void setIcon(gPicture *pic);
void setMask(bool vl);
void setPicture(gPicture *pic);
void setText(const char *txt);
void setTopOnly(bool vl);
void setSkipTaskBar(bool b);
void setMinimized(bool vl);
void setMaximized(bool vl);
void setFullscreen(bool vl);
void setSticky(bool vl);
void setStacking(int vl);
void setPersistent(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
virtual void setVisible(bool vl);
virtual void setRealBackground(gColor vl);
virtual void setFont(gFont *ft);
virtual int clientWidth();
virtual int clientHeight();
virtual int clientX();
virtual int clientY();
virtual int containerX();
virtual int containerY();
bool spontaneous() { return !_not_spontaneous; }
void setMenuBarVisible(bool v);
bool isMenuBarVisible();
//"Methods"
void center();
void showModal();
void raise();
virtual void move(int x, int y);
virtual void resize(int w, int h);
bool close();
virtual void reparent(gContainer *newpr, int x, int y);
//"Signals"
void (*onOpen)(gMainWindow *sender);
void (*onShow)(gMainWindow *sender);
void (*onHide)(gMainWindow *sender);
void (*onMove)(gMainWindow *sender);
void (*onResize)(gMainWindow *sender);
bool (*onClose)(gMainWindow *sender);
void (*onActivate)(gMainWindow *sender);
void (*onDeactivate)(gMainWindow *sender);
//"Static"
static GList *windows;
static int count() { return g_list_length(windows); }
static gMainWindow *get(int index) { return (gMainWindow *)g_list_nth_data(windows, index); }
static gMainWindow *_active;
static void setActiveWindow(gControl *control);
static gMainWindow *_current;
//"Private"
void initialize();
void drawMask();
void initWindow();
void emitOpen();
void remap();
bool doClose();
void afterShow();
[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 checkMenuBar();
int menuBarHeight();
void configure();
void embedMenuBar(GtkWidget *border);
GtkWindowGroup *group;
GtkAccelGroup *accel;
GtkMenuBar *menuBar;
[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
GtkFixed *layout;
int stack;
int _type;
gPicture *_icon;
gPicture *_picture;
char *_title;
GdkPixmap *_background;
GtkStyle *_style;
gControl *focus;
gButton *_default;
gButton *_cancel;
int _next_w, _next_h;
guint _next_timer;
unsigned _mask : 1;
unsigned top_only : 1;
unsigned _resized : 1;
unsigned persistent : 1;
unsigned sticky : 1;
unsigned opened : 1;
unsigned _closing : 1;
unsigned _not_spontaneous : 1;
unsigned _skip_taskbar : 1;
unsigned _masked : 1;
unsigned _xembed : 1;
unsigned _activate : 1;
[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
unsigned _hidden : 1;
[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
unsigned _hideMenuBar : 1;
unsigned _showMenuBar : 1;
};
#endif