494 lines
10 KiB
C++
Raw Normal View History

/***************************************************************************
CTextBox.cpp
(c) 2004-2005 - 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.
***************************************************************************/
#define __CTEXTBOX_CPP
#include <stdlib.h>
#include <string.h>
#include "main.h"
#include "gambas.h"
#include "widgets.h"
#include "CTextBox.h"
#include "CWidget.h"
#include "CContainer.h"
DECLARE_EVENT(EVENT_Change);
DECLARE_EVENT(EVENT_Activate);
DECLARE_EVENT(EVENT_Click);
/*static void txt_post_change(void *_object)
{
GB.Raise(THIS, EVENT_Change, 0);
GB.Unref(POINTER(&_object));
}*/
static void txt_raise_change(gTextBox *sender)
{
CWIDGET *_object = GetObject((gControl*)sender);
GB.Raise(THIS, EVENT_Change, 0);
}
static void txt_raise_activate(gTextBox *sender)
{
CWIDGET *_object = GetObject((gControl*)sender);
GB.Raise(THIS, EVENT_Activate, 0);
}
static void cmb_raise_click(gComboBox *sender)
{
CWIDGET *_object = GetObject((gControl*)sender);
GB.Raise(THIS, EVENT_Click, 0);
}
/***************************************************************************
TextBox
***************************************************************************/
BEGIN_METHOD(CTEXTBOX_new, GB_OBJECT parent)
InitControl(new gTextBox(CONTAINER(VARG(parent))), (CWIDGET*)THIS);
TEXTBOX->onChange = txt_raise_change;
TEXTBOX->onActivate = txt_raise_activate;
END_METHOD
BEGIN_METHOD_VOID(CTEXTBOX_clear)
TEXTBOX->clear();
END_METHOD
BEGIN_METHOD(CTEXTBOX_insert, GB_STRING text)
TEXTBOX->insert(STRING(text),LENGTH(text));
END_METHOD
BEGIN_PROPERTY(CTEXTBOX_text)
if (READ_PROPERTY)
GB.ReturnNewZeroString(TEXTBOX->text());
else
TEXTBOX->setText(GB.ToZeroString(PROP(GB_STRING)));
END_PROPERTY
BEGIN_PROPERTY(CTEXTBOX_length)
GB.ReturnInteger(TEXTBOX->length());
END_PROPERTY
BEGIN_PROPERTY(CTEXTBOX_alignment)
if (READ_PROPERTY) { GB.ReturnInteger(TEXTBOX->alignment()); return; }
TEXTBOX->setAlignment(VPROP(GB_INTEGER));
END_PROPERTY
BEGIN_PROPERTY(CTEXTBOX_pos)
if (READ_PROPERTY) { GB.ReturnInteger(TEXTBOX->position()); return; }
TEXTBOX->setPosition(VPROP(GB_INTEGER));
END_PROPERTY
BEGIN_PROPERTY(CTEXTBOX_read_only)
if (READ_PROPERTY) { GB.ReturnBoolean(TEXTBOX->isReadOnly()); return; }
TEXTBOX->setReadOnly(VPROP(GB_BOOLEAN));
END_PROPERTY
BEGIN_PROPERTY(CTEXTBOX_border)
if (READ_PROPERTY) { GB.ReturnBoolean(TEXTBOX->hasBorder()); return; }
TEXTBOX->setBorder(VPROP(GB_BOOLEAN));
END_PROPERTY
BEGIN_PROPERTY(CTEXTBOX_password)
if (READ_PROPERTY) { GB.ReturnBoolean(TEXTBOX->password()); return; }
TEXTBOX->setPassword(VPROP(GB_BOOLEAN));
END_PROPERTY
BEGIN_PROPERTY(CTEXTBOX_max_length)
if (READ_PROPERTY) { GB.ReturnInteger(TEXTBOX->maxLength()); return; }
TEXTBOX->setMaxLength(VPROP(GB_INTEGER));
END_PROPERTY
BEGIN_PROPERTY(CTEXTBOX_selection)
RETURN_SELF();
END_PROPERTY
BEGIN_METHOD_VOID(CTEXTBOX_selected)
GB.ReturnBoolean(TEXTBOX->isSelected());
END_METHOD
/***************************************************************************
.TextBox.Selection
***************************************************************************/
BEGIN_PROPERTY(CTEXTBOX_sel_text)
char *buf;
if (READ_PROPERTY)
{
buf=TEXTBOX->selText();
GB.ReturnNewString(buf,0);
g_free(buf);
return;
}
buf=GB.ToZeroString(PROP(GB_STRING));
TEXTBOX->setSelText(buf,strlen(buf));
END_PROPERTY
BEGIN_PROPERTY(CTEXTBOX_sel_length)
GB.ReturnInteger(TEXTBOX->selLength());
END_PROPERTY
BEGIN_PROPERTY(CTEXTBOX_sel_start)
GB.ReturnInteger(TEXTBOX->selStart());
END_PROPERTY
BEGIN_METHOD_VOID(CTEXTBOX_sel_clear)
TEXTBOX->selClear();
END_METHOD
BEGIN_METHOD_VOID(CTEXTBOX_sel_all)
TEXTBOX->selectAll();
END_METHOD
BEGIN_METHOD(CTEXTBOX_sel_select, GB_INTEGER start; GB_INTEGER length)
TEXTBOX->select(VARG(start),VARG(length));
END_METHOD
/***************************************************************************
ComboBox
***************************************************************************/
#undef THIS
#define THIS ((CCOMBOBOX *)_object)
BEGIN_METHOD(CCOMBOBOX_new, GB_OBJECT parent)
InitControl(new gComboBox(CONTAINER(VARG(parent))), (CWIDGET*)THIS);
COMBOBOX->onClick = cmb_raise_click;
COMBOBOX->onChange = txt_raise_change;
COMBOBOX->onActivate = txt_raise_activate;
END_METHOD
BEGIN_PROPERTY(CCOMBOBOX_text)
if (READ_PROPERTY)
GB.ReturnNewZeroString(COMBOBOX->text());
else
COMBOBOX->setText(GB.ToZeroString(PROP(GB_STRING)));
END_PROPERTY
BEGIN_METHOD_VOID(CCOMBOBOX_popup)
COMBOBOX->popup();
END_METHOD
BEGIN_METHOD(CCOMBOBOX_get, GB_INTEGER index)
[DEVELOPMENT ENVIRONMENT] * NEW: Some little fixes in the hall of fame animations. * BUG: Fix the layout of the property sheet text edit dialog. * NEW: A new highlighting theme, named 'Quick'. * NEW: The '(Scaled)' virtual property has been renamed as 'Scaled'. * BUG: Fix the "quit" icon in the quit dialog. * BUG: Correctly raise an error when making an executable fails for any reason. * BUG: Extract the property help better. [WIKI CGI SCRIPT] * BUG: Auto link now really makes one identical link between two titles. [INTERPRETER] * OPT: Optimization of additions of small integers. * BUG: INC and DEC now toggle boolean values. * NEW: Use the new '.startup' file to run a project. The old '.project' file can be used for older projects. But its support will be removed in the final version. [COMPILER] * NEW: A '.startup' file is now created at each compilation. It contains an extract of the '.project' file with just what the interpreter needs to run the application. [GB.GTK] * BUG: Void items are correctly handled by ComboBox without crashing now. [GB.EVAL] * BUG: Quoted symbols, i.e. symbols between braces, are now correctly colorized by using the identifier colors. [GB.FORM] * BUG: Removed the useless Tag property from the DatePicker control. * BUG: Fix the height of the DateChooser toolbar. * NEW: Wizard.ShowIndex is a new property that makes the wizard control automatically display the index of the current step. This index takes into account if some steps are disabled. [GB.FORM.DIALOG] * NEW: Dialog.SelectDate() is a new method that allows the user to select a date in a dialog box having a date chooser. [GB.QT] * BUG: You can now resize a non resizable window without having to change its Border property first. [GB.QT.EXT] * BUG: Editor correctly goes to the end of file when pressing CTRL+END. Consequently, SelectAll() works correctly too now. * NEW: Comments just before a procedure are now never folded. git-svn-id: svn://localhost/gambas/trunk@1317 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-04-17 10:18:25 +00:00
int index = VARG(index);
if (index < 0 || index >= COMBOBOX->count())
{
GB.Error("Bad index");
return;
}
THIS->index = index;
RETURN_SELF();
END_METHOD
BEGIN_PROPERTY(CCOMBOBOX_item_text)
if (READ_PROPERTY)
GB.ReturnNewZeroString(COMBOBOX->itemText(THIS->index));
else
COMBOBOX->setItemText(THIS->index,GB.ToZeroString(PROP(GB_STRING)));
END_PROPERTY
BEGIN_METHOD(CCOMBOBOX_add, GB_STRING item; GB_INTEGER pos)
[DEVELOPMENT ENVIRONMENT] * NEW: Some little fixes in the hall of fame animations. * BUG: Fix the layout of the property sheet text edit dialog. * NEW: A new highlighting theme, named 'Quick'. * NEW: The '(Scaled)' virtual property has been renamed as 'Scaled'. * BUG: Fix the "quit" icon in the quit dialog. * BUG: Correctly raise an error when making an executable fails for any reason. * BUG: Extract the property help better. [WIKI CGI SCRIPT] * BUG: Auto link now really makes one identical link between two titles. [INTERPRETER] * OPT: Optimization of additions of small integers. * BUG: INC and DEC now toggle boolean values. * NEW: Use the new '.startup' file to run a project. The old '.project' file can be used for older projects. But its support will be removed in the final version. [COMPILER] * NEW: A '.startup' file is now created at each compilation. It contains an extract of the '.project' file with just what the interpreter needs to run the application. [GB.GTK] * BUG: Void items are correctly handled by ComboBox without crashing now. [GB.EVAL] * BUG: Quoted symbols, i.e. symbols between braces, are now correctly colorized by using the identifier colors. [GB.FORM] * BUG: Removed the useless Tag property from the DatePicker control. * BUG: Fix the height of the DateChooser toolbar. * NEW: Wizard.ShowIndex is a new property that makes the wizard control automatically display the index of the current step. This index takes into account if some steps are disabled. [GB.FORM.DIALOG] * NEW: Dialog.SelectDate() is a new method that allows the user to select a date in a dialog box having a date chooser. [GB.QT] * BUG: You can now resize a non resizable window without having to change its Border property first. [GB.QT.EXT] * BUG: Editor correctly goes to the end of file when pressing CTRL+END. Consequently, SelectAll() works correctly too now. * NEW: Comments just before a procedure are now never folded. git-svn-id: svn://localhost/gambas/trunk@1317 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-04-17 10:18:25 +00:00
int Pos;
char *Item=GB.ToZeroString(ARG(item));
if (MISSING(pos)) Pos=COMBOBOX->count();
else Pos=VARG(pos);
COMBOBOX->add(Item,Pos);
END_METHOD
BEGIN_METHOD(CCOMBOBOX_remove, GB_INTEGER pos)
COMBOBOX->remove(VARG(pos));
END_METHOD
BEGIN_PROPERTY(CCOMBOBOX_sorted)
if (READ_PROPERTY) { GB.ReturnBoolean(COMBOBOX->isSorted()); return; }
COMBOBOX->setSorted(VPROP(GB_BOOLEAN));
END_METHOD
BEGIN_PROPERTY(CCOMBOBOX_count)
GB.ReturnInteger(COMBOBOX->count());
END_PROPERTY
BEGIN_PROPERTY(CCOMBOBOX_index)
if (READ_PROPERTY) { GB.ReturnInteger(COMBOBOX->index()); return; }
COMBOBOX->setIndex(VPROP(GB_INTEGER));
END_PROPERTY
BEGIN_PROPERTY(CCOMBOBOX_current)
if (!COMBOBOX->count()) { GB.ReturnNull(); return; }
THIS->index=COMBOBOX->index();
RETURN_SELF();
END_PROPERTY
BEGIN_METHOD(CCOMBOBOX_find, GB_STRING item)
GB.ReturnInteger(COMBOBOX->find(GB.ToZeroString(ARG(item))));
END_METHOD
BEGIN_PROPERTY(CCOMBOBOX_list)
GB_ARRAY array;
int i;
char *text;
if (READ_PROPERTY)
{
GB.Array.New(&array, GB_T_STRING, COMBOBOX->count());
for (i = 0; i < COMBOBOX->count(); i++)
{
GB.NewString(&text, COMBOBOX->itemText(i), 0);
*((char **)GB.Array.Get(array, i)) = text;
}
GB.ReturnObject(array);
}
else
{
array = VPROP(GB_OBJECT);
COMBOBOX->lock();
COMBOBOX->clear();
if (array)
{
for (i = 0; i < GB.Array.Count(array); i++)
COMBOBOX->add(*((char **)GB.Array.Get(array, i)));
}
[DEVELOPMENT ENVIRONMENT] * BUG: Fix option dialog now that [...] can return specialized arrays. * BUG: Fix the list of control properties that must not be applied in the form editor. * NEW: Automatically converts Window.Toolbar constant to Window.Utility. * NEW: Setting the form Type property to Utility has a visible effect now. * BUG: The find balloon message is always displayed in the accurate field now. [GB.GTK] * BUG: Fix the initialization of editable combo-box when its List property is set. * NEW: The Window.Toolbar constant were replaced by Window.Utility. [GB.FORM] * NEW: Draw SidePanel little arrows in a more clever way. * BUG: Font grades are selectable again in the FontChooser control. [GB.FORM.MDI] * NEW: Toolbars have a configuration dialog now. This configuration dialog is displayed when you click on the toolbar handle. Beware, this is not finished! * NEW: Toolbar.Key is a new text property for identifying the toolbar. All toolbars having the same key will share the same configuration. * NEW: Toolbar.Text is a new text property that gives a visual name to the toolbar. [GB.QT] * BUG: Setting Control.Next or Control.Previous now forces the parent container to re-arrange itself. * NEW: The Window.Toolbar constant were replaced by Window.Utility. * NEW: ToolButton.AutoResize is a new property that makes the toolbutton automatically expand horizontally to fit its contents. * NEW: Button and ToggleButton got the same AutoResize property. * NEW: Remove the DrawingArea.BackColor property. [GB.QT4] * BUG: Setting Control.Next or Control.Previous now forces the parent container to re-arrange itself. * NEW: Remove the DrawingArea.BackColor property. * NEW: The Window.Toolbar constant were replaced by Window.Utility. git-svn-id: svn://localhost/gambas/trunk@1789 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2009-01-06 00:01:26 +00:00
COMBOBOX->setIndex(-1);
COMBOBOX->unlock();
[DEVELOPMENT ENVIRONMENT] * BUG: Fix option dialog now that [...] can return specialized arrays. * BUG: Fix the list of control properties that must not be applied in the form editor. * NEW: Automatically converts Window.Toolbar constant to Window.Utility. * NEW: Setting the form Type property to Utility has a visible effect now. * BUG: The find balloon message is always displayed in the accurate field now. [GB.GTK] * BUG: Fix the initialization of editable combo-box when its List property is set. * NEW: The Window.Toolbar constant were replaced by Window.Utility. [GB.FORM] * NEW: Draw SidePanel little arrows in a more clever way. * BUG: Font grades are selectable again in the FontChooser control. [GB.FORM.MDI] * NEW: Toolbars have a configuration dialog now. This configuration dialog is displayed when you click on the toolbar handle. Beware, this is not finished! * NEW: Toolbar.Key is a new text property for identifying the toolbar. All toolbars having the same key will share the same configuration. * NEW: Toolbar.Text is a new text property that gives a visual name to the toolbar. [GB.QT] * BUG: Setting Control.Next or Control.Previous now forces the parent container to re-arrange itself. * NEW: The Window.Toolbar constant were replaced by Window.Utility. * NEW: ToolButton.AutoResize is a new property that makes the toolbutton automatically expand horizontally to fit its contents. * NEW: Button and ToggleButton got the same AutoResize property. * NEW: Remove the DrawingArea.BackColor property. [GB.QT4] * BUG: Setting Control.Next or Control.Previous now forces the parent container to re-arrange itself. * NEW: Remove the DrawingArea.BackColor property. * NEW: The Window.Toolbar constant were replaced by Window.Utility. git-svn-id: svn://localhost/gambas/trunk@1789 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2009-01-06 00:01:26 +00:00
if (array)
COMBOBOX->setIndex(0);
}
END_PROPERTY
/***************************************************************************
Descriptions
***************************************************************************/
GB_DESC CTextBoxSelectionDesc[] =
{
GB_DECLARE(".TextBoxSelection", 0), GB_VIRTUAL_CLASS(),
GB_PROPERTY("Text", "s", CTEXTBOX_sel_text),
GB_PROPERTY_READ("Length", "i", CTEXTBOX_sel_length),
GB_PROPERTY_READ("Start", "i", CTEXTBOX_sel_start),
GB_PROPERTY_READ("Pos", "i", CTEXTBOX_sel_start),
******** Merged /branches/64bits r918:1003 into /trunk [CONFIGURATION] * NEW: 64 bits port. [EXAMPLES] * BUG: Fixed the AnalogWatch example. [WIKI CGI SCRIPT] * NEW: Some little cosmetic changes. [INTERPRETER] * NEW: The extern function implementation has been redesigned and is now based on libffi, so that it works on 64 bits system. Because of a flaw in the compiler design, projects that use the Pointer datatype must be recompiled to be used on a 64 bits system. This flaw will be fixed in Gambas 3. * OPT: Put some tables into read-only memory. About 1000 bytes are saved for each running interpreter, except the first one. * BUG: Does not crash anymore if a component cannot be loaded. * NEW: Spanish translation updated. * NEW: A new interpreter API for returning a pointer. [COMPILER] * BUG: Correctly compiles LONG constants inside code. [GB.DEBUG] * BUG: Compiles and links the gb.debug components with the thread libraries. [GB.DB.SQLITE3] * BUG: Getting the primary index of a table without primary index is safe now. [GB.GTK] * BUG: Modified the GLib priority of watched descriptors, as the main loop could enter in a loop in which user interface events were not managed. * BUG: Message boxes use application title without crashing now. [GB.OPENGL] * BUG: Disable dead code. [GB.QT.EXT] * BUG: TextEdit.TextWidth and TextEdit.TextHeight were not declared as read-only properties. [GB.XML.XSLT] * BUG: XSLT class is now declared as being not creatable. git-svn-id: svn://localhost/gambas/trunk@1006 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-01-17 21:39:26 +00:00
GB_METHOD("Hide", 0, CTEXTBOX_sel_clear, 0),
GB_END_DECLARE
};
GB_DESC CTextBoxDesc[] =
{
GB_DECLARE("TextBox", sizeof(CTEXTBOX)), GB_INHERITS("Control"),
******** Merged /branches/64bits r918:1003 into /trunk [CONFIGURATION] * NEW: 64 bits port. [EXAMPLES] * BUG: Fixed the AnalogWatch example. [WIKI CGI SCRIPT] * NEW: Some little cosmetic changes. [INTERPRETER] * NEW: The extern function implementation has been redesigned and is now based on libffi, so that it works on 64 bits system. Because of a flaw in the compiler design, projects that use the Pointer datatype must be recompiled to be used on a 64 bits system. This flaw will be fixed in Gambas 3. * OPT: Put some tables into read-only memory. About 1000 bytes are saved for each running interpreter, except the first one. * BUG: Does not crash anymore if a component cannot be loaded. * NEW: Spanish translation updated. * NEW: A new interpreter API for returning a pointer. [COMPILER] * BUG: Correctly compiles LONG constants inside code. [GB.DEBUG] * BUG: Compiles and links the gb.debug components with the thread libraries. [GB.DB.SQLITE3] * BUG: Getting the primary index of a table without primary index is safe now. [GB.GTK] * BUG: Modified the GLib priority of watched descriptors, as the main loop could enter in a loop in which user interface events were not managed. * BUG: Message boxes use application title without crashing now. [GB.OPENGL] * BUG: Disable dead code. [GB.QT.EXT] * BUG: TextEdit.TextWidth and TextEdit.TextHeight were not declared as read-only properties. [GB.XML.XSLT] * BUG: XSLT class is now declared as being not creatable. git-svn-id: svn://localhost/gambas/trunk@1006 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-01-17 21:39:26 +00:00
GB_METHOD("_new", 0, CTEXTBOX_new, "(Parent)Container;"),
GB_PROPERTY("Text", "s", CTEXTBOX_text),
GB_PROPERTY("Alignment", "i", CTEXTBOX_alignment),
GB_PROPERTY_READ("Length", "i", CTEXTBOX_length),
GB_PROPERTY("Pos", "i", CTEXTBOX_pos),
GB_PROPERTY("ReadOnly", "b", CTEXTBOX_read_only),
GB_PROPERTY("Border", "b", CTEXTBOX_border),
GB_PROPERTY("Password", "b", CTEXTBOX_password),
GB_PROPERTY("MaxLength", "i", CTEXTBOX_max_length),
GB_PROPERTY_SELF("Selection", ".TextBoxSelection"),
******** Merged /branches/64bits r918:1003 into /trunk [CONFIGURATION] * NEW: 64 bits port. [EXAMPLES] * BUG: Fixed the AnalogWatch example. [WIKI CGI SCRIPT] * NEW: Some little cosmetic changes. [INTERPRETER] * NEW: The extern function implementation has been redesigned and is now based on libffi, so that it works on 64 bits system. Because of a flaw in the compiler design, projects that use the Pointer datatype must be recompiled to be used on a 64 bits system. This flaw will be fixed in Gambas 3. * OPT: Put some tables into read-only memory. About 1000 bytes are saved for each running interpreter, except the first one. * BUG: Does not crash anymore if a component cannot be loaded. * NEW: Spanish translation updated. * NEW: A new interpreter API for returning a pointer. [COMPILER] * BUG: Correctly compiles LONG constants inside code. [GB.DEBUG] * BUG: Compiles and links the gb.debug components with the thread libraries. [GB.DB.SQLITE3] * BUG: Getting the primary index of a table without primary index is safe now. [GB.GTK] * BUG: Modified the GLib priority of watched descriptors, as the main loop could enter in a loop in which user interface events were not managed. * BUG: Message boxes use application title without crashing now. [GB.OPENGL] * BUG: Disable dead code. [GB.QT.EXT] * BUG: TextEdit.TextWidth and TextEdit.TextHeight were not declared as read-only properties. [GB.XML.XSLT] * BUG: XSLT class is now declared as being not creatable. git-svn-id: svn://localhost/gambas/trunk@1006 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-01-17 21:39:26 +00:00
GB_METHOD("Select", 0, CTEXTBOX_sel_select, "[(Start)i(Length)i]"),
GB_METHOD("SelectAll", 0, CTEXTBOX_sel_all, 0),
GB_METHOD("Unselect", 0, CTEXTBOX_sel_clear, 0),
GB_PROPERTY_READ("Selected", "b", CTEXTBOX_selected),
******** Merged /branches/64bits r918:1003 into /trunk [CONFIGURATION] * NEW: 64 bits port. [EXAMPLES] * BUG: Fixed the AnalogWatch example. [WIKI CGI SCRIPT] * NEW: Some little cosmetic changes. [INTERPRETER] * NEW: The extern function implementation has been redesigned and is now based on libffi, so that it works on 64 bits system. Because of a flaw in the compiler design, projects that use the Pointer datatype must be recompiled to be used on a 64 bits system. This flaw will be fixed in Gambas 3. * OPT: Put some tables into read-only memory. About 1000 bytes are saved for each running interpreter, except the first one. * BUG: Does not crash anymore if a component cannot be loaded. * NEW: Spanish translation updated. * NEW: A new interpreter API for returning a pointer. [COMPILER] * BUG: Correctly compiles LONG constants inside code. [GB.DEBUG] * BUG: Compiles and links the gb.debug components with the thread libraries. [GB.DB.SQLITE3] * BUG: Getting the primary index of a table without primary index is safe now. [GB.GTK] * BUG: Modified the GLib priority of watched descriptors, as the main loop could enter in a loop in which user interface events were not managed. * BUG: Message boxes use application title without crashing now. [GB.OPENGL] * BUG: Disable dead code. [GB.QT.EXT] * BUG: TextEdit.TextWidth and TextEdit.TextHeight were not declared as read-only properties. [GB.XML.XSLT] * BUG: XSLT class is now declared as being not creatable. git-svn-id: svn://localhost/gambas/trunk@1006 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-01-17 21:39:26 +00:00
GB_METHOD("Clear", 0, CTEXTBOX_clear, 0),
GB_METHOD("Insert", 0, CTEXTBOX_insert, "(Text)s"),
******** Merged /branches/64bits r918:1003 into /trunk [CONFIGURATION] * NEW: 64 bits port. [EXAMPLES] * BUG: Fixed the AnalogWatch example. [WIKI CGI SCRIPT] * NEW: Some little cosmetic changes. [INTERPRETER] * NEW: The extern function implementation has been redesigned and is now based on libffi, so that it works on 64 bits system. Because of a flaw in the compiler design, projects that use the Pointer datatype must be recompiled to be used on a 64 bits system. This flaw will be fixed in Gambas 3. * OPT: Put some tables into read-only memory. About 1000 bytes are saved for each running interpreter, except the first one. * BUG: Does not crash anymore if a component cannot be loaded. * NEW: Spanish translation updated. * NEW: A new interpreter API for returning a pointer. [COMPILER] * BUG: Correctly compiles LONG constants inside code. [GB.DEBUG] * BUG: Compiles and links the gb.debug components with the thread libraries. [GB.DB.SQLITE3] * BUG: Getting the primary index of a table without primary index is safe now. [GB.GTK] * BUG: Modified the GLib priority of watched descriptors, as the main loop could enter in a loop in which user interface events were not managed. * BUG: Message boxes use application title without crashing now. [GB.OPENGL] * BUG: Disable dead code. [GB.QT.EXT] * BUG: TextEdit.TextWidth and TextEdit.TextHeight were not declared as read-only properties. [GB.XML.XSLT] * BUG: XSLT class is now declared as being not creatable. git-svn-id: svn://localhost/gambas/trunk@1006 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-01-17 21:39:26 +00:00
GB_EVENT("Change", 0, 0, &EVENT_Change),
GB_EVENT("Activate", 0, 0, &EVENT_Activate),
TEXTBOX_DESCRIPTION,
GB_END_DECLARE
};
GB_DESC CComboBoxItemDesc[] =
{
GB_DECLARE(".ComboBoxItem", 0), GB_VIRTUAL_CLASS(),
GB_PROPERTY("Text", "s", CCOMBOBOX_item_text),
GB_END_DECLARE
};
GB_DESC CComboBoxDesc[] =
{
GB_DECLARE("ComboBox", sizeof(CCOMBOBOX)), GB_INHERITS("Control"),
******** Merged /branches/64bits r918:1003 into /trunk [CONFIGURATION] * NEW: 64 bits port. [EXAMPLES] * BUG: Fixed the AnalogWatch example. [WIKI CGI SCRIPT] * NEW: Some little cosmetic changes. [INTERPRETER] * NEW: The extern function implementation has been redesigned and is now based on libffi, so that it works on 64 bits system. Because of a flaw in the compiler design, projects that use the Pointer datatype must be recompiled to be used on a 64 bits system. This flaw will be fixed in Gambas 3. * OPT: Put some tables into read-only memory. About 1000 bytes are saved for each running interpreter, except the first one. * BUG: Does not crash anymore if a component cannot be loaded. * NEW: Spanish translation updated. * NEW: A new interpreter API for returning a pointer. [COMPILER] * BUG: Correctly compiles LONG constants inside code. [GB.DEBUG] * BUG: Compiles and links the gb.debug components with the thread libraries. [GB.DB.SQLITE3] * BUG: Getting the primary index of a table without primary index is safe now. [GB.GTK] * BUG: Modified the GLib priority of watched descriptors, as the main loop could enter in a loop in which user interface events were not managed. * BUG: Message boxes use application title without crashing now. [GB.OPENGL] * BUG: Disable dead code. [GB.QT.EXT] * BUG: TextEdit.TextWidth and TextEdit.TextHeight were not declared as read-only properties. [GB.XML.XSLT] * BUG: XSLT class is now declared as being not creatable. git-svn-id: svn://localhost/gambas/trunk@1006 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-01-17 21:39:26 +00:00
GB_METHOD("_new", 0, CCOMBOBOX_new, "(Parent)Container;"),
GB_METHOD("_get", ".ComboBoxItem", CCOMBOBOX_get, "(Index)i"),
******** Merged /branches/64bits r918:1003 into /trunk [CONFIGURATION] * NEW: 64 bits port. [EXAMPLES] * BUG: Fixed the AnalogWatch example. [WIKI CGI SCRIPT] * NEW: Some little cosmetic changes. [INTERPRETER] * NEW: The extern function implementation has been redesigned and is now based on libffi, so that it works on 64 bits system. Because of a flaw in the compiler design, projects that use the Pointer datatype must be recompiled to be used on a 64 bits system. This flaw will be fixed in Gambas 3. * OPT: Put some tables into read-only memory. About 1000 bytes are saved for each running interpreter, except the first one. * BUG: Does not crash anymore if a component cannot be loaded. * NEW: Spanish translation updated. * NEW: A new interpreter API for returning a pointer. [COMPILER] * BUG: Correctly compiles LONG constants inside code. [GB.DEBUG] * BUG: Compiles and links the gb.debug components with the thread libraries. [GB.DB.SQLITE3] * BUG: Getting the primary index of a table without primary index is safe now. [GB.GTK] * BUG: Modified the GLib priority of watched descriptors, as the main loop could enter in a loop in which user interface events were not managed. * BUG: Message boxes use application title without crashing now. [GB.OPENGL] * BUG: Disable dead code. [GB.QT.EXT] * BUG: TextEdit.TextWidth and TextEdit.TextHeight were not declared as read-only properties. [GB.XML.XSLT] * BUG: XSLT class is now declared as being not creatable. git-svn-id: svn://localhost/gambas/trunk@1006 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-01-17 21:39:26 +00:00
GB_METHOD("Popup", 0, CCOMBOBOX_popup, 0),
GB_METHOD("Clear", 0, CTEXTBOX_clear, 0),
GB_METHOD("Insert", 0, CTEXTBOX_insert, "(Text)s"),
GB_METHOD("Add", 0, CCOMBOBOX_add, "(Item)s[(Index)i]"),
GB_METHOD("Remove", 0, CCOMBOBOX_remove, "(Index)i"),
GB_METHOD("Find", "i", CCOMBOBOX_find, "(Item)s"),
GB_PROPERTY("Text", "s", CCOMBOBOX_text),
GB_PROPERTY_READ("Length", "i", CTEXTBOX_length),
GB_PROPERTY("Pos", "i", CTEXTBOX_pos),
GB_PROPERTY("ReadOnly", "b", CTEXTBOX_read_only),
GB_PROPERTY("Password", "b", CTEXTBOX_password),
GB_PROPERTY("MaxLength", "i", CTEXTBOX_max_length),
GB_PROPERTY_SELF("Selection", ".TextBoxSelection"),
******** Merged /branches/64bits r918:1003 into /trunk [CONFIGURATION] * NEW: 64 bits port. [EXAMPLES] * BUG: Fixed the AnalogWatch example. [WIKI CGI SCRIPT] * NEW: Some little cosmetic changes. [INTERPRETER] * NEW: The extern function implementation has been redesigned and is now based on libffi, so that it works on 64 bits system. Because of a flaw in the compiler design, projects that use the Pointer datatype must be recompiled to be used on a 64 bits system. This flaw will be fixed in Gambas 3. * OPT: Put some tables into read-only memory. About 1000 bytes are saved for each running interpreter, except the first one. * BUG: Does not crash anymore if a component cannot be loaded. * NEW: Spanish translation updated. * NEW: A new interpreter API for returning a pointer. [COMPILER] * BUG: Correctly compiles LONG constants inside code. [GB.DEBUG] * BUG: Compiles and links the gb.debug components with the thread libraries. [GB.DB.SQLITE3] * BUG: Getting the primary index of a table without primary index is safe now. [GB.GTK] * BUG: Modified the GLib priority of watched descriptors, as the main loop could enter in a loop in which user interface events were not managed. * BUG: Message boxes use application title without crashing now. [GB.OPENGL] * BUG: Disable dead code. [GB.QT.EXT] * BUG: TextEdit.TextWidth and TextEdit.TextHeight were not declared as read-only properties. [GB.XML.XSLT] * BUG: XSLT class is now declared as being not creatable. git-svn-id: svn://localhost/gambas/trunk@1006 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-01-17 21:39:26 +00:00
GB_METHOD("Select", 0, CTEXTBOX_sel_select, "[(Start)i(Length)i]"),
GB_METHOD("SelectAll", 0, CTEXTBOX_sel_all, 0),
GB_METHOD("Unselect", 0, CTEXTBOX_sel_clear, 0),
GB_PROPERTY_READ("Selected", "b", CTEXTBOX_selected),
GB_PROPERTY("Sorted", "b", CCOMBOBOX_sorted),
GB_PROPERTY("List", "String[]", CCOMBOBOX_list),
GB_PROPERTY_READ("Count", "i", CCOMBOBOX_count),
GB_PROPERTY_READ("Current", ".ComboBoxItem", CCOMBOBOX_current),
GB_PROPERTY("Index", "i", CCOMBOBOX_index),
******** Merged /branches/64bits r918:1003 into /trunk [CONFIGURATION] * NEW: 64 bits port. [EXAMPLES] * BUG: Fixed the AnalogWatch example. [WIKI CGI SCRIPT] * NEW: Some little cosmetic changes. [INTERPRETER] * NEW: The extern function implementation has been redesigned and is now based on libffi, so that it works on 64 bits system. Because of a flaw in the compiler design, projects that use the Pointer datatype must be recompiled to be used on a 64 bits system. This flaw will be fixed in Gambas 3. * OPT: Put some tables into read-only memory. About 1000 bytes are saved for each running interpreter, except the first one. * BUG: Does not crash anymore if a component cannot be loaded. * NEW: Spanish translation updated. * NEW: A new interpreter API for returning a pointer. [COMPILER] * BUG: Correctly compiles LONG constants inside code. [GB.DEBUG] * BUG: Compiles and links the gb.debug components with the thread libraries. [GB.DB.SQLITE3] * BUG: Getting the primary index of a table without primary index is safe now. [GB.GTK] * BUG: Modified the GLib priority of watched descriptors, as the main loop could enter in a loop in which user interface events were not managed. * BUG: Message boxes use application title without crashing now. [GB.OPENGL] * BUG: Disable dead code. [GB.QT.EXT] * BUG: TextEdit.TextWidth and TextEdit.TextHeight were not declared as read-only properties. [GB.XML.XSLT] * BUG: XSLT class is now declared as being not creatable. git-svn-id: svn://localhost/gambas/trunk@1006 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-01-17 21:39:26 +00:00
GB_EVENT("Change", 0, 0, &EVENT_Change),
GB_EVENT("Activate", 0, 0, &EVENT_Activate),
GB_EVENT("Click", 0, 0, &EVENT_Click),
******** Merged /branches/64bits r918:1003 into /trunk [CONFIGURATION] * NEW: 64 bits port. [EXAMPLES] * BUG: Fixed the AnalogWatch example. [WIKI CGI SCRIPT] * NEW: Some little cosmetic changes. [INTERPRETER] * NEW: The extern function implementation has been redesigned and is now based on libffi, so that it works on 64 bits system. Because of a flaw in the compiler design, projects that use the Pointer datatype must be recompiled to be used on a 64 bits system. This flaw will be fixed in Gambas 3. * OPT: Put some tables into read-only memory. About 1000 bytes are saved for each running interpreter, except the first one. * BUG: Does not crash anymore if a component cannot be loaded. * NEW: Spanish translation updated. * NEW: A new interpreter API for returning a pointer. [COMPILER] * BUG: Correctly compiles LONG constants inside code. [GB.DEBUG] * BUG: Compiles and links the gb.debug components with the thread libraries. [GB.DB.SQLITE3] * BUG: Getting the primary index of a table without primary index is safe now. [GB.GTK] * BUG: Modified the GLib priority of watched descriptors, as the main loop could enter in a loop in which user interface events were not managed. * BUG: Message boxes use application title without crashing now. [GB.OPENGL] * BUG: Disable dead code. [GB.QT.EXT] * BUG: TextEdit.TextWidth and TextEdit.TextHeight were not declared as read-only properties. [GB.XML.XSLT] * BUG: XSLT class is now declared as being not creatable. git-svn-id: svn://localhost/gambas/trunk@1006 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2008-01-17 21:39:26 +00:00
COMBOBOX_DESCRIPTION,
GB_END_DECLARE
};