[CONFIGURATION]
* BUG: FreeBSD patches. [INTERPRETER] * BUG: FreeBSD patches. [COMPILER] * NEW: Support for FreeBSD getopt_long(). [ARCHIVER] * NEW: Support for FreeBSD getopt_long(). [INFORMER] * NEW: Support for FreeBSD getopt_long(). [SCRIPTER] * BUG: The <%...%> markups are now taken into account everywhere inside a server page. [WIKI CGI SCRIPT] * BUG: Speeds up the rename function. [GB.COMPRESS.ZLIB] * BUG: Do not include the Linux specific header <bits/wordsize.h> anymore. [GB.DB.ODBC] * BUG: Removed some compilation warnings. [GB.GTK] * BUG: ComboBox now raises focus events. * BUG: Newly opened windows are now correctly shown at the specified position. * BUG: DrawingArea.Clear() does not erase the border anymore if the DrawingArea is cached. * BUG: Hiding a row or a column does not prevent the mouse wheel to work anymore in the GridView control. [GB.QT] * BUG: Compound controls like ComboBox should not raise spurious focus events anymore. * BUG: Fix a possible crash in GridView repaint. [GB.QT4] * BUG: Compound controls like ComboBox should not raise spurious focus events anymore. git-svn-id: svn://localhost/gambas/trunk@1955 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
39685d8ecd
commit
a83d81f98d
29 changed files with 269 additions and 188 deletions
|
@ -327,7 +327,7 @@ AC_DEFUN([GB_MATH],
|
|||
[
|
||||
case "${host}" in
|
||||
*-*-freebsd* )
|
||||
MATH_LIB="-lm -lml"
|
||||
MATH_LIB="-lm"
|
||||
;;
|
||||
*)
|
||||
MATH_LIB="-lm"
|
||||
|
|
|
@ -154,241 +154,241 @@ msgstr ""
|
|||
msgid "Rename children"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:2714
|
||||
#: Main.module:2719
|
||||
msgid "This documentation page already exists."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:2774
|
||||
#: Main.module:2779
|
||||
msgid "&1 - History"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:2865
|
||||
#: Main.module:2870
|
||||
msgid "No change"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:2881
|
||||
#: Main.module:2886
|
||||
msgid "Creation"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:2895
|
||||
#: Main.module:2900
|
||||
msgid "Welcome back &1!"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:2942
|
||||
#: Main.module:2947
|
||||
msgid "User management"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:2953
|
||||
#: Main.module:2958
|
||||
msgid "Create user"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:2955
|
||||
#: Main.module:2960
|
||||
msgid "Edit user"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:2957
|
||||
#: Main.module:2962
|
||||
msgid "Delete user"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:2964
|
||||
#: Main.module:2969
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:2965
|
||||
#: Main.module:2970
|
||||
msgid "Password"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:2966
|
||||
#: Main.module:2971
|
||||
msgid "Confirm"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3009
|
||||
#: Main.module:3014
|
||||
msgid "Database management"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3012
|
||||
#: Main.module:3017
|
||||
msgid "Download database"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3016
|
||||
#: Main.module:3021
|
||||
msgid "Purge temporary files"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3036
|
||||
#: Main.module:3041
|
||||
msgid "Please enter a user name."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3038
|
||||
#: Main.module:3043
|
||||
msgid "Passwords do not match."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3040
|
||||
#: Main.module:3045
|
||||
msgid "Please enter a password."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3042
|
||||
#: Main.module:3047
|
||||
msgid "User already exists."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3046
|
||||
#: Main.module:3051
|
||||
msgid "User '&1' created."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3048
|
||||
#: Main.module:3053
|
||||
msgid "Cannot create user '&1'. Error code #&2."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3062
|
||||
#: Main.module:3067
|
||||
msgid "User '&1' modified."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3064
|
||||
#: Main.module:3069
|
||||
msgid "Cannot edit user '&1'. Error code #&2."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3073
|
||||
#: Main.module:3078
|
||||
msgid "Cannot delete user 'gambas'. This user is reserved."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3077
|
||||
#: Main.module:3082
|
||||
msgid "User '&1' deleted."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3079
|
||||
#: Main.module:3084
|
||||
msgid "Cannot delete user '&1'. Error code #&2."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3101
|
||||
#: Main.module:3106
|
||||
msgid "Return to administration page"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3114
|
||||
#: Main.module:3119
|
||||
msgid "Search with Google"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3177
|
||||
#: Main.module:3182
|
||||
msgid "Classes"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3347
|
||||
#: Main.module:3352
|
||||
msgid "Date"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3347
|
||||
#: Main.module:3352
|
||||
msgid "User"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3347
|
||||
#: Main.module:3352
|
||||
msgid "Page"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3380
|
||||
#: Main.module:3385
|
||||
msgid "State"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3521
|
||||
#: Main.module:3526
|
||||
msgid "Symbols"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3530
|
||||
#: Main.module:3535
|
||||
msgid "This class reimplements"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3532
|
||||
#: Main.module:3537
|
||||
msgid "This class inherits"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3538
|
||||
#: Main.module:3543
|
||||
msgid "in"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3546
|
||||
#: Main.module:3551
|
||||
msgid "This class is &1."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3548
|
||||
#: Main.module:3553
|
||||
msgid ""
|
||||
"This class can be used like an object by creating an hidden instance on "
|
||||
"demand."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3552
|
||||
#: Main.module:3557
|
||||
msgid "creatable"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3555
|
||||
#: Main.module:3560
|
||||
msgid "This class is static."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3557
|
||||
#: Main.module:3562
|
||||
msgid "This class is not creatable."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3563
|
||||
#: Main.module:3568
|
||||
msgid "This class acts like a &1 / &2 array."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3563
|
||||
#: Main.module:3568
|
||||
msgid "read"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3563
|
||||
#: Main.module:3568
|
||||
msgid "write"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3565
|
||||
#: Main.module:3570
|
||||
msgid "This class acts like a &1 array."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3565
|
||||
#: Main.module:3570
|
||||
msgid "read-only"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3571
|
||||
#: Main.module:3576
|
||||
msgid "This class is &1 with the &2 keyword."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3571
|
||||
#: Main.module:3576
|
||||
msgid "enumerable"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3575
|
||||
#: Main.module:3580
|
||||
msgid "This class can be used as a &1."
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3575
|
||||
#: Main.module:3580
|
||||
msgid "function"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3587
|
||||
#: Main.module:3592
|
||||
msgid "Static properties"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3588
|
||||
#: Main.module:3593
|
||||
msgid "Static methods"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3590
|
||||
#: Main.module:3595
|
||||
msgid "Constants"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3607
|
||||
#: Main.module:3612
|
||||
msgid "Properties"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3608
|
||||
#: Main.module:3613
|
||||
msgid "Methods"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:3609
|
||||
#: Main.module:3614
|
||||
msgid "Events"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:4121
|
||||
#: Main.module:4126
|
||||
msgid "Only in &1 version"
|
||||
msgstr ""
|
||||
|
||||
#: Main.module:4157
|
||||
#: Main.module:4162
|
||||
msgid "There are &1 classes and &2 symbols in all Gambas components."
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -2659,12 +2659,17 @@ Private Sub RenamePage()
|
|||
|
||||
End
|
||||
|
||||
Private Sub RenameOnePage(sPath As String, sNewPath As String)
|
||||
Private Sub RenameOnePage(sPath As String, sNewPath As String, Optional sPrefix As String)
|
||||
|
||||
Dim rPage As Result
|
||||
Dim sOld As String
|
||||
|
||||
rPage = DB.Edit("page")
|
||||
If sPrefix Then
|
||||
rPage = DB.Edit("page", "sPath like &1", Replace(sPrefix, "%", "%%") & "%")
|
||||
Else
|
||||
rPage = DB.Edit("page")
|
||||
Endif
|
||||
|
||||
While rPage.Available
|
||||
|
||||
If Left$(File.Name(rPage!sPath)) <> ":" Then
|
||||
|
@ -2724,13 +2729,13 @@ Private Sub DoRenamePage()
|
|||
|
||||
Else
|
||||
|
||||
rPage = DB.Edit("page")
|
||||
rPage = DB.Edit("page", "sPath like &1", Replace($sPath, "%", "%%") & "%")
|
||||
While rPage.Available
|
||||
|
||||
If Left$(File.Name(rPage!sPath)) <> ":" Then
|
||||
|
||||
If rPage!sPath Like ($sPath & "*") Then
|
||||
RenameOnePage(rPage!sPath, sNewPath & Mid$(rPage!sPath, Len($sPath) + 1))
|
||||
RenameOnePage(rPage!sPath, sNewPath & Mid$(rPage!sPath, Len($sPath) + 1), $sPath)
|
||||
Endif
|
||||
|
||||
Endif
|
||||
|
|
|
@ -47,7 +47,7 @@ File[1]="MMain.module:229.31"
|
|||
Fold[1]=[]
|
||||
File[2]="CComponent.class:169.37"
|
||||
Fold[2]=[]
|
||||
File[3]="MServerPage.module:0.0"
|
||||
File[3]="MServerPage.module:134.0"
|
||||
Fold[3]=[]
|
||||
File[4]="helptext:8.11"
|
||||
Count=4
|
||||
|
|
|
@ -60,7 +60,7 @@ Public Sub Make(sPath As String) As String
|
|||
|
||||
Do
|
||||
|
||||
iPos2 = InStr(sData, "<", iPos + 1)
|
||||
iPos2 = InStr(sData, "<%", iPos + 1)
|
||||
If iPos2 = 0 Then
|
||||
PrintHTML(Mid$(sData, iPos + 1))
|
||||
Break
|
||||
|
@ -69,7 +69,7 @@ Public Sub Make(sPath As String) As String
|
|||
iPos = iPos2
|
||||
Endif
|
||||
|
||||
If Mid$(sData, iPos, 2) = "<%" Then
|
||||
'If Mid$(sData, iPos, 2) = "<%" Then
|
||||
|
||||
' Search for closing "%>" by jumping Gambas syntax
|
||||
Do
|
||||
|
@ -101,38 +101,38 @@ Public Sub Make(sPath As String) As String
|
|||
|
||||
iPos = iPos2 + 1
|
||||
|
||||
Else If Mid$(sData, iPos, 3) = "<--" Then
|
||||
|
||||
' Search for closing "-->"
|
||||
iPos2 = InStr(sData, "-->", iPos + 3)
|
||||
|
||||
PrintHTML(Mid$(sData, iPos, iPos2 - iPos + 3))
|
||||
|
||||
iPos = iPos2 + 2
|
||||
|
||||
Else
|
||||
|
||||
' Search for closing ">" by jumping markup syntax
|
||||
Do
|
||||
Inc iPos2
|
||||
If iPos2 > Len(sData) Then Break
|
||||
sCar = Mid$(sData, iPos2, 1)
|
||||
If sWait Then
|
||||
If sCar = sWait Then sWait = ""
|
||||
Else If sCar = ">" Then
|
||||
Break
|
||||
Else If sCar = Chr$(34) Then
|
||||
sWait = Chr$(34)
|
||||
Else If sCar = "'" Then
|
||||
sWait = "'"
|
||||
Endif
|
||||
Loop
|
||||
|
||||
PrintHTML(Mid$(sData, iPos, iPos2 - iPos + 1))
|
||||
|
||||
iPos = iPos2
|
||||
|
||||
Endif
|
||||
' Else If Mid$(sData, iPos, 3) = "<--" Then
|
||||
'
|
||||
' ' Search for closing "-->"
|
||||
' iPos2 = InStr(sData, "-->", iPos + 3)
|
||||
'
|
||||
' PrintHTML(Mid$(sData, iPos, iPos2 - iPos + 3))
|
||||
'
|
||||
' iPos = iPos2 + 2
|
||||
'
|
||||
' Else
|
||||
'
|
||||
' ' Search for closing ">" by jumping markup syntax
|
||||
' Do
|
||||
' Inc iPos2
|
||||
' If iPos2 > Len(sData) Then Break
|
||||
' sCar = Mid$(sData, iPos2, 1)
|
||||
' If sWait Then
|
||||
' If sCar = sWait Then sWait = ""
|
||||
' Else If sCar = ">" Then
|
||||
' Break
|
||||
' Else If sCar = Chr$(34) Then
|
||||
' sWait = Chr$(34)
|
||||
' Else If sCar = "'" Then
|
||||
' sWait = "'"
|
||||
' Endif
|
||||
' Loop
|
||||
'
|
||||
' PrintHTML(Mid$(sData, iPos, iPos2 - iPos + 1))
|
||||
'
|
||||
' iPos = iPos2
|
||||
'
|
||||
' Endif
|
||||
|
||||
Loop
|
||||
|
||||
|
|
|
@ -24,10 +24,9 @@
|
|||
|
||||
#define __MAIN_C
|
||||
|
||||
#include <bits/wordsize.h>
|
||||
#include "gb_common.h"
|
||||
|
||||
// Use 64 bits I/O
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#if __WORDSIZE == 64
|
||||
#define _LARGEFILE64_SOURCE
|
||||
#endif
|
||||
|
|
|
@ -40,6 +40,14 @@
|
|||
#include <sqlext.h>
|
||||
#include <sqltypes.h>
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#undef HAVE_UNISTD_H
|
||||
#endif
|
||||
|
||||
#include "main.h"
|
||||
|
||||
|
||||
|
|
|
@ -100,6 +100,22 @@ static void combo_cell_text(GtkComboBox *combo, GtkCellRenderer *cell, GtkTreeMo
|
|||
(void *)NULL);
|
||||
}
|
||||
|
||||
static GtkWidget *_button;
|
||||
|
||||
static void cb_find_button(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
if (GTK_IS_TOGGLE_BUTTON(widget))
|
||||
_button = widget;
|
||||
else if (GTK_IS_CONTAINER(widget))
|
||||
gtk_container_forall(GTK_CONTAINER(widget), cb_find_button, NULL);
|
||||
}
|
||||
|
||||
static GtkWidget *find_button(GtkWidget *combo)
|
||||
{
|
||||
_button = NULL;
|
||||
gtk_container_forall(GTK_CONTAINER(combo), cb_find_button, NULL);
|
||||
return _button;
|
||||
}
|
||||
|
||||
char *gComboBox::indexToKey(int index)
|
||||
{
|
||||
|
@ -122,7 +138,7 @@ gComboBox::gComboBox(gContainer *parent) : gTextBox(parent, true)
|
|||
);
|
||||
_style_init = TRUE;
|
||||
}*/
|
||||
|
||||
|
||||
onChange = NULL;
|
||||
onClick = NULL;
|
||||
onActivate = NULL;
|
||||
|
@ -132,6 +148,7 @@ gComboBox::gComboBox(gContainer *parent) : gTextBox(parent, true)
|
|||
_model_dirty = false;
|
||||
sort = false;
|
||||
entry = NULL;
|
||||
_button = NULL;
|
||||
|
||||
g_typ = Type_gComboBox;
|
||||
|
||||
|
@ -151,7 +168,9 @@ gComboBox::gComboBox(gContainer *parent) : gTextBox(parent, true)
|
|||
realize(false);
|
||||
|
||||
g_signal_connect(G_OBJECT(widget), "changed", G_CALLBACK(cb_click), (gpointer)this);
|
||||
|
||||
|
||||
//button = ((_GtkComboBoxPrivate *)GTK_COMBO_BOX(widget)->priv)->arrow->parent;
|
||||
updateFocusHandler();
|
||||
setReadOnly(false);
|
||||
}
|
||||
|
||||
|
@ -169,7 +188,7 @@ void gComboBox::setRealBackground(gColor color)
|
|||
{
|
||||
gControl::setRealBackground(color);
|
||||
if (entry)
|
||||
set_gdk_base_color(entry,color);
|
||||
set_gdk_base_color(entry, color);
|
||||
}
|
||||
|
||||
|
||||
|
@ -279,24 +298,25 @@ void gComboBox::setReadOnly(bool vl)
|
|||
|
||||
if ((!vl) && (!entry) )
|
||||
{
|
||||
entry = gtk_entry_new();
|
||||
entry = gtk_entry_new ();
|
||||
/* this flag is a hack to tell the entry to fill its allocation. */
|
||||
GTK_ENTRY(entry)->is_cell_renderer = TRUE;
|
||||
gtk_container_add(GTK_CONTAINER(widget), entry);
|
||||
//gtk_widget_set_size_request(entry, width(), height());
|
||||
gtk_widget_show(entry);
|
||||
|
||||
if (count())
|
||||
gTextBox::setText(itemText(index()));
|
||||
|
||||
//gtk_widget_get_size_request(widget,&x,&y);
|
||||
gtk_widget_set_size_request(entry, width(), height());
|
||||
//set_gdk_base_color(txtentry,background());
|
||||
//set_gdk_text_color(txtentry,foreground());
|
||||
setBackground(background());
|
||||
setForeground(foreground());
|
||||
setFont(font());
|
||||
|
||||
initEntry();
|
||||
g_signal_connect(G_OBJECT(entry),"key-press-event",G_CALLBACK(gcb_keypress),(gpointer)this);
|
||||
g_signal_connect(G_OBJECT(entry),"key-release-event",G_CALLBACK(gcb_keyrelease),(gpointer)this);
|
||||
|
||||
gtk_widget_show(entry);
|
||||
g_signal_connect(G_OBJECT(entry), "key-press-event", G_CALLBACK(gcb_keypress), (gpointer)this);
|
||||
g_signal_connect(G_OBJECT(entry), "key-release-event", G_CALLBACK(gcb_keyrelease), (gpointer)this);
|
||||
g_signal_connect(G_OBJECT(entry), "focus-in-event", G_CALLBACK(gcb_focus_in), (gpointer)this);
|
||||
g_signal_connect(G_OBJECT(entry), "focus-out-event", G_CALLBACK(gcb_focus_out), (gpointer)this);
|
||||
}
|
||||
|
||||
if ( vl && entry )
|
||||
|
@ -305,6 +325,8 @@ void gComboBox::setReadOnly(bool vl)
|
|||
//gtk_container_remove(GTK_CONTAINER(widget), entry);
|
||||
entry = NULL;
|
||||
}
|
||||
|
||||
updateFocusHandler();
|
||||
}
|
||||
|
||||
void gComboBox::setSorted(bool vl)
|
||||
|
@ -377,7 +399,7 @@ void gComboBox::add(const char *text, int pos)
|
|||
updateSort();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//gtk_combo_box_set_model(GTK_COMBO_BOX(widget), model);
|
||||
}
|
||||
|
||||
|
@ -455,3 +477,34 @@ bool gComboBox::isReadOnly()
|
|||
return entry == NULL;
|
||||
}
|
||||
|
||||
|
||||
static gboolean button_focus_in(GtkWidget *widget, GdkEventFocus *event, gComboBox *control)
|
||||
{
|
||||
if (control->isReadOnly())
|
||||
return gcb_focus_in(widget, event, control);
|
||||
|
||||
control->setFocus();
|
||||
return false;
|
||||
}
|
||||
|
||||
static gboolean button_focus_out(GtkWidget *widget, GdkEventFocus *event, gComboBox *control)
|
||||
{
|
||||
if (control->isReadOnly())
|
||||
return gcb_focus_out(widget, event, control);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void gComboBox::updateFocusHandler()
|
||||
{
|
||||
GtkWidget *button = find_button(widget);
|
||||
|
||||
if (button == _button)
|
||||
return;
|
||||
|
||||
_button = button;
|
||||
//g_signal_connect(G_OBJECT(button), "key-press-event", G_CALLBACK(gcb_keypress), (gpointer)this);
|
||||
//g_signal_connect(G_OBJECT(button), "key-release-event", G_CALLBACK(gcb_keyrelease), (gpointer)this);
|
||||
g_signal_connect(G_OBJECT(button), "focus-in-event", G_CALLBACK(button_focus_in), (gpointer)this);
|
||||
g_signal_connect(G_OBJECT(button), "focus-out-event", G_CALLBACK(button_focus_out), (gpointer)this);
|
||||
}
|
||||
|
|
|
@ -50,12 +50,14 @@ public:
|
|||
gTree *tree;
|
||||
bool _model_dirty;
|
||||
int _last_key;
|
||||
GtkWidget *_button;
|
||||
|
||||
void updateModel();
|
||||
void updateSort();
|
||||
char *indexToKey(int index);
|
||||
char* find(GtkTreePath *path) { return tree->pathToKey(path, false); }
|
||||
void checkIndex();
|
||||
void updateFocusHandler();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -246,7 +246,8 @@ void gDrawingArea::clear()
|
|||
gdk_gc_set_foreground(gc2,&widget->style->bg[GTK_STATE_NORMAL]);
|
||||
gdk_draw_rectangle(buffer,gc2,true,0,0,width(),height());
|
||||
g_object_unref(G_OBJECT(gc2));
|
||||
//updateCache();
|
||||
drawBorder(buffer);
|
||||
refreshCache();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -970,7 +970,7 @@ void gGridView::calculateBars()
|
|||
if (bh)
|
||||
{
|
||||
gtk_range_set_range(GTK_RANGE(hbar),0,render->width());
|
||||
gtk_range_set_increments(GTK_RANGE(hbar),render->getColumnSize(0),vw);
|
||||
gtk_range_set_increments(GTK_RANGE(hbar),minColumnWidth(0) * 3,vw);
|
||||
adj=gtk_range_get_adjustment(GTK_RANGE(hbar));
|
||||
g_object_set(G_OBJECT(adj),"page-size",(gfloat)vw,(void *)NULL);
|
||||
}
|
||||
|
@ -978,7 +978,7 @@ void gGridView::calculateBars()
|
|||
if (bv)
|
||||
{
|
||||
gtk_range_set_range(GTK_RANGE(vbar),0,render->height());
|
||||
gtk_range_set_increments(GTK_RANGE(vbar),render->getRowSize(0),vh);
|
||||
gtk_range_set_increments(GTK_RANGE(vbar),minRowHeight(0) * 3,vh);
|
||||
adj=gtk_range_get_adjustment(GTK_RANGE(vbar));
|
||||
g_object_set(G_OBJECT(adj),"page-size",(gfloat)vh,(void *)NULL);
|
||||
}
|
||||
|
|
|
@ -472,6 +472,7 @@ void gMainWindow::setVisible(bool vl)
|
|||
gtk_window_set_transient_for(GTK_WINDOW(border), GTK_WINDOW(active->border));
|
||||
|
||||
gtk_window_present(GTK_WINDOW(border));
|
||||
gtk_window_move(GTK_WINDOW(border), bufX, bufY);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -256,7 +256,7 @@ static gboolean sg_scroll(GtkWidget *widget,GdkEventScroll *event,gControl *data
|
|||
return false;
|
||||
}
|
||||
|
||||
static gboolean sg_focus_In(GtkWidget *widget,GdkEventFocus *event,gControl *data)
|
||||
gboolean gcb_focus_in(GtkWidget *widget,GdkEventFocus *event,gControl *data)
|
||||
{
|
||||
//fprintf(stderr, "sg_focus_in: %s\n", data->name());
|
||||
|
||||
|
@ -271,7 +271,7 @@ static gboolean sg_focus_In(GtkWidget *widget,GdkEventFocus *event,gControl *dat
|
|||
return false;
|
||||
}
|
||||
|
||||
static gboolean sg_focus_Out(GtkWidget *widget,GdkEventFocus *event,gControl *data)
|
||||
gboolean gcb_focus_out(GtkWidget *widget,GdkEventFocus *event,gControl *data)
|
||||
{
|
||||
//fprintf(stderr, "sg_focus_out: %s\n", data->name());
|
||||
|
||||
|
@ -492,8 +492,8 @@ void gControl::widgetSignals()
|
|||
|
||||
g_signal_connect(G_OBJECT(widget),"key-press-event",G_CALLBACK(gcb_keypress),(gpointer)this);
|
||||
g_signal_connect(G_OBJECT(widget),"key-release-event",G_CALLBACK(gcb_keyrelease),(gpointer)this);
|
||||
g_signal_connect(G_OBJECT(widget),"focus-in-event",G_CALLBACK(sg_focus_In),(gpointer)this);
|
||||
g_signal_connect(G_OBJECT(widget),"focus-out-event",G_CALLBACK(sg_focus_Out),(gpointer)this);
|
||||
g_signal_connect(G_OBJECT(widget),"focus-in-event",G_CALLBACK(gcb_focus_in),(gpointer)this);
|
||||
g_signal_connect(G_OBJECT(widget),"focus-out-event",G_CALLBACK(gcb_focus_out),(gpointer)this);
|
||||
g_signal_connect(G_OBJECT(widget),"event",G_CALLBACK(sg_event),(gpointer)this);
|
||||
}
|
||||
|
||||
|
|
|
@ -48,8 +48,10 @@ GtkStyle *gt_get_style(const char *name, int type);
|
|||
|
||||
gboolean gcb_keypress (GtkWidget *widget, GdkEventKey *event, gControl *data);
|
||||
gboolean gcb_keyrelease (GtkWidget *widget, GdkEventKey *event, gControl *data);
|
||||
gboolean gcb_button_press(GtkWidget *widget,GdkEventButton *event,gControl *data);
|
||||
gboolean gcb_button_release(GtkWidget *widget,GdkEventButton *event,gControl *data);
|
||||
gboolean gcb_button_press(GtkWidget *widget, GdkEventButton *event, gControl *data);
|
||||
gboolean gcb_button_release(GtkWidget *widget, GdkEventButton *event, gControl *data);
|
||||
gboolean gcb_focus_in(GtkWidget *widget, GdkEventFocus *event, gControl *data);
|
||||
gboolean gcb_focus_out(GtkWidget *widget, GdkEventFocus *event, gControl *data);
|
||||
|
||||
// Where to scroll to ensure that a specific area is visible
|
||||
|
||||
|
|
|
@ -185,6 +185,10 @@ int MyTableItem::alignment() const
|
|||
void MyTableItem::paint( QPainter *p, const QColorGroup &cg, const QRect &cr, bool selected )
|
||||
{
|
||||
MyTableData *d = data();
|
||||
|
||||
if (!d) // May happen, do not know why!
|
||||
return;
|
||||
|
||||
int w = cr.width();
|
||||
int h = cr.height();
|
||||
int x = 0;
|
||||
|
|
|
@ -121,7 +121,8 @@ END_PROPERTY
|
|||
|
||||
BEGIN_PROPERTY(CAPP_active_control)
|
||||
|
||||
GB.ReturnObject(CWidget::get(qApp->focusWidget()));
|
||||
//GB.ReturnObject(CWidget::get(qApp->focusWidget()));
|
||||
GB.ReturnObject(CWIDGET_active_control);
|
||||
|
||||
END_PROPERTY
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
|
||||
CWIDGET *CWIDGET_destroy_list = 0;
|
||||
CWIDGET *CWIDGET_destroy_last = 0;
|
||||
CWIDGET *CWIDGET_active_control = 0;
|
||||
|
||||
GB_CLASS CLASS_Control;
|
||||
GB_CLASS CLASS_Container;
|
||||
|
@ -1646,6 +1647,9 @@ void CWidget::destroy()
|
|||
if (enter == ob)
|
||||
enter = NULL;
|
||||
|
||||
if (CWIDGET_active_control == ob)
|
||||
CWIDGET_active_control = NULL;
|
||||
|
||||
set_name(ob, 0);
|
||||
|
||||
dict.remove(w);
|
||||
|
@ -1726,8 +1730,12 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
|
|||
{
|
||||
if (GB.CanRaise(control, EVENT_GotFocus))
|
||||
{
|
||||
GB.Ref(control);
|
||||
GB.Post((void (*)())post_gotfocus_event, (intptr_t)control);
|
||||
if (control != CWIDGET_active_control)
|
||||
{
|
||||
CWIDGET_active_control = control;
|
||||
GB.Ref(control);
|
||||
GB.Post((void (*)())post_gotfocus_event, (intptr_t)control);
|
||||
}
|
||||
}
|
||||
|
||||
CWINDOW_activate(control);
|
||||
|
@ -1737,8 +1745,12 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
|
|||
{
|
||||
if (GB.CanRaise(control, EVENT_LostFocus))
|
||||
{
|
||||
GB.Ref(control);
|
||||
GB.Post((void (*)())post_lostfocus_event, (intptr_t)control);
|
||||
if (control == CWIDGET_active_control)
|
||||
{
|
||||
CWIDGET_active_control = NULL;
|
||||
GB.Ref(control);
|
||||
GB.Post((void (*)())post_lostfocus_event, (intptr_t)control);
|
||||
}
|
||||
}
|
||||
//GB.Raise(control, EVENT_LostFocus, 0);
|
||||
}
|
||||
|
|
|
@ -94,6 +94,7 @@ enum {
|
|||
extern GB_DESC CControlDesc[];
|
||||
extern CWIDGET *CWIDGET_destroy_list;
|
||||
extern CWIDGET *CWIDGET_destroy_last;
|
||||
extern CWIDGET *CWIDGET_active_control;
|
||||
|
||||
extern GB_CLASS CLASS_Control;
|
||||
extern GB_CLASS CLASS_Container;
|
||||
|
|
|
@ -100,7 +100,7 @@ END_PROPERTY
|
|||
|
||||
BEGIN_PROPERTY(CAPP_active_control)
|
||||
|
||||
GB.ReturnObject(CWidget::get(qApp->focusWidget()));
|
||||
GB.ReturnObject(CWIDGET_active_control);
|
||||
|
||||
END_PROPERTY
|
||||
|
||||
|
|
|
@ -76,6 +76,8 @@ static QMap<int, int> _x11_to_qt_keycode;
|
|||
|
||||
/* Control class */
|
||||
|
||||
CWIDGET *CWIDGET_active_control = 0;
|
||||
|
||||
|
||||
static void set_mouse(QWidget *w, int mouse, void *cursor)
|
||||
{
|
||||
|
@ -1690,6 +1692,9 @@ void CWidget::destroy()
|
|||
if (enter == ob)
|
||||
enter = NULL;
|
||||
|
||||
if (CWIDGET_active_control == ob)
|
||||
CWIDGET_active_control = NULL;
|
||||
|
||||
set_name(ob, 0);
|
||||
|
||||
dict.remove(w);
|
||||
|
@ -1763,26 +1768,34 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event)
|
|||
if (real)
|
||||
GB.Raise(control, EVENT_Leave, 0);
|
||||
}
|
||||
else if (type == QEvent::FocusIn)
|
||||
{
|
||||
if (GB.CanRaise(control, EVENT_GotFocus))
|
||||
{
|
||||
GB.Ref(control);
|
||||
GB.Post((void (*)())post_gotfocus_event, (intptr_t)control);
|
||||
else if (type == QEvent::FocusIn)
|
||||
{
|
||||
if (GB.CanRaise(control, EVENT_GotFocus))
|
||||
{
|
||||
if (control != CWIDGET_active_control)
|
||||
{
|
||||
CWIDGET_active_control = control;
|
||||
GB.Ref(control);
|
||||
GB.Post((void (*)())post_gotfocus_event, (intptr_t)control);
|
||||
}
|
||||
}
|
||||
|
||||
CWINDOW_activate(control);
|
||||
//GB.Raise(control, EVENT_GotFocus, 0);
|
||||
}
|
||||
else if (type == QEvent::FocusOut)
|
||||
{
|
||||
if (GB.CanRaise(control, EVENT_LostFocus))
|
||||
{
|
||||
GB.Ref(control);
|
||||
GB.Post((void (*)())post_lostfocus_event, (intptr_t)control);
|
||||
//GB.Raise(control, EVENT_GotFocus, 0);
|
||||
}
|
||||
else if (type == QEvent::FocusOut)
|
||||
{
|
||||
if (GB.CanRaise(control, EVENT_LostFocus))
|
||||
{
|
||||
if (control == CWIDGET_active_control)
|
||||
{
|
||||
CWIDGET_active_control = NULL;
|
||||
GB.Ref(control);
|
||||
GB.Post((void (*)())post_lostfocus_event, (intptr_t)control);
|
||||
}
|
||||
}
|
||||
//GB.Raise(control, EVENT_LostFocus, 0);
|
||||
}
|
||||
//GB.Raise(control, EVENT_LostFocus, 0);
|
||||
}
|
||||
else if (type == QEvent::ContextMenu)
|
||||
{
|
||||
// if (real && GB.CanRaise(control, EVENT_Menu))
|
||||
|
|
|
@ -90,6 +90,7 @@ enum {
|
|||
#ifndef __CWIDGET_CPP
|
||||
|
||||
extern GB_DESC CControlDesc[];
|
||||
extern CWIDGET *CWIDGET_active_control;
|
||||
|
||||
extern GB_CLASS CLASS_Control;
|
||||
extern GB_CLASS CLASS_Container;
|
||||
|
|
|
@ -79,7 +79,7 @@ dnl ---- Should I use libtool to load shared libraries in gbi and gbx ?
|
|||
|
||||
if test "$SYSTEM" != "CYGWIN"; then
|
||||
AC_DEFINE(DONT_USE_LTDL, 1, [Do not use libtool to load shared libraries])
|
||||
if test "$SYSTEM" != "OPENBSD"; then
|
||||
if test "$SYSTEM" != "OPENBSD" && test "$SYSTEM" != "FREEBSD"; then
|
||||
DL_LIB="-ldl"
|
||||
else
|
||||
DL_LIB=""
|
||||
|
|
|
@ -39,10 +39,6 @@
|
|||
#include <sys/time.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#include "gb_common.h"
|
||||
#include "gb_error.h"
|
||||
#include "gb_str.h"
|
||||
|
@ -52,7 +48,7 @@
|
|||
|
||||
#include "gbc_archive.h"
|
||||
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if HAVE_GETOPT_LONG
|
||||
static struct option Long_options[] =
|
||||
{
|
||||
{ "version", 0, NULL, 'V' },
|
||||
|
@ -74,13 +70,13 @@ static const char *remove_ext_lang[] = { "pot", "po", NULL };
|
|||
static void get_arguments(int argc, char **argv)
|
||||
{
|
||||
int opt;
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if HAVE_GETOPT_LONG
|
||||
int index = 0;
|
||||
#endif
|
||||
|
||||
for(;;)
|
||||
{
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if HAVE_GETOPT_LONG
|
||||
opt = getopt_long(argc, argv, "vVhso:", Long_options, &index);
|
||||
#else
|
||||
opt = getopt(argc, argv, "vVhso:");
|
||||
|
@ -113,7 +109,7 @@ static void get_arguments(int argc, char **argv)
|
|||
COPYRIGHT
|
||||
"Usage: gba" GAMBAS_VERSION_STRING " [options] [<project directory>]\n\n"
|
||||
"Options:"
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if HAVE_GETOPT_LONG
|
||||
"\n"
|
||||
" -o --output=ARCHIVE archive path [<project directory>/<project name>.gambas]\n"
|
||||
" -v --verbose verbose output\n"
|
||||
|
|
|
@ -40,9 +40,6 @@
|
|||
#include <dirent.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#include "gb_common.h"
|
||||
#include "gb_error.h"
|
||||
|
@ -60,7 +57,7 @@
|
|||
#include "gbc_output.h"
|
||||
|
||||
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if HAVE_GETOPT_LONG
|
||||
static struct option Long_options[] =
|
||||
{
|
||||
{ "debug", 0, NULL, 'g' },
|
||||
|
@ -94,13 +91,13 @@ static void get_arguments(int argc, char **argv)
|
|||
{
|
||||
const char *dir;
|
||||
int opt;
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if HAVE_GETOPT_LONG
|
||||
int index = 0;
|
||||
#endif
|
||||
|
||||
for(;;)
|
||||
{
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if HAVE_GETOPT_LONG
|
||||
opt = getopt_long(argc, argv, "gvaVhtpmsr:", Long_options, &index);
|
||||
#else
|
||||
opt = getopt(argc, argv, "gvaVhtpmsr:");
|
||||
|
@ -156,7 +153,7 @@ static void get_arguments(int argc, char **argv)
|
|||
COPYRIGHT
|
||||
"Usage: gbc" GAMBAS_VERSION_STRING " [options] [<project directory>]\n\n"
|
||||
"Options:"
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if HAVE_GETOPT_LONG
|
||||
"\n"
|
||||
" -g --debug add debugging information\n"
|
||||
" -v --verbose verbose output\n"
|
||||
|
|
|
@ -28,11 +28,6 @@
|
|||
#include "gb_common.h"
|
||||
#include "gb_alloc.h"
|
||||
|
||||
#ifdef __GNU_LIBRARY__
|
||||
//#define _GNU_SOURCE already defined before
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
@ -48,7 +43,7 @@
|
|||
|
||||
#include <dlfcn.h>
|
||||
|
||||
#if defined(OS_LINUX) || defined(OS_OPENBSD)
|
||||
#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_FREEBSD)
|
||||
#define lt_dlinit() (0)
|
||||
#define lt_dlhandle void *
|
||||
#define lt_dlopenext(_path) dlopen(_path, RTLD_LAZY)
|
||||
|
@ -89,7 +84,7 @@ static char **_components = NULL;
|
|||
|
||||
static void analyze(const char *comp, bool include);
|
||||
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if HAVE_GETOPT_LONG
|
||||
static struct option LongOptions[] =
|
||||
{
|
||||
{ "version", 0, NULL, 'V' },
|
||||
|
@ -679,7 +674,7 @@ int main(int argc, char **argv)
|
|||
char *name;
|
||||
int opt;
|
||||
int save_fd;
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if HAVE_GETOPT_LONG
|
||||
int ind = 0;
|
||||
#endif
|
||||
|
||||
|
@ -695,7 +690,7 @@ int main(int argc, char **argv)
|
|||
|
||||
for(;;)
|
||||
{
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if HAVE_GETOPT_LONG
|
||||
opt = getopt_long(argc, argv, "vVhpar:", LongOptions, &ind);
|
||||
#else
|
||||
opt = getopt(argc, argv, "vVhpar:");
|
||||
|
@ -732,7 +727,7 @@ int main(int argc, char **argv)
|
|||
COPYRIGHT
|
||||
"Usage: gbi" GAMBAS_VERSION_STRING " [options] [components]\n"
|
||||
"Options:"
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if HAVE_GETOPT_LONG
|
||||
"\n"
|
||||
" -V --version display version\n"
|
||||
" -h --help display this help\n"
|
||||
|
@ -793,7 +788,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#if HAVE_GETOPT_LONG
|
||||
if (!getenv("GB_PRELOAD"))
|
||||
{
|
||||
for (ind = optind; ind < argc; ind++)
|
||||
|
|
|
@ -32,11 +32,6 @@
|
|||
|
||||
#include <dlfcn.h>
|
||||
|
||||
#ifdef __GNU_LIBRARY__
|
||||
//#define _GNU_SOURCE
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
|
||||
#include "gbx_class.h"
|
||||
#include "gbx_exec.h"
|
||||
#include "gbx_stack.h"
|
||||
|
|
|
@ -43,10 +43,6 @@ double log2(double x)
|
|||
return log(x) / M_LN2;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(OS_OPENBSD) || defined(OS_CYGWIN)
|
||||
|
||||
double exp2(double x)
|
||||
{
|
||||
return pow(2, x);
|
||||
|
@ -236,7 +232,7 @@ double rnd(void)
|
|||
val <<= 32;
|
||||
val |= GFSR_random();
|
||||
|
||||
return (double)val / 0xFFFFFFFFFFFFFFFFULL;
|
||||
return (double)val / 18446744073709551616.0; //0xFFFFFFFFFFFFFFFFULL;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -50,9 +50,6 @@ double exp10(double x);
|
|||
#undef log2
|
||||
#endif
|
||||
double log2(double x);
|
||||
#endif
|
||||
|
||||
#if defined(OS_OPENBSD) || defined(OS_CYGWIN)
|
||||
double exp2(double x);
|
||||
long double log10l(long double x);
|
||||
long double fabsl(long double x);
|
||||
|
|
|
@ -34,9 +34,6 @@
|
|||
#define _FILE_OFFSET_BITS 64
|
||||
|
||||
#include <math.h>
|
||||
#ifdef OS_FREEBSD
|
||||
#include <mathl.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
@ -49,6 +46,11 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#if defined(__GNU_LIBRARY__) || defined(OS_FREEBSD)
|
||||
#include <getopt.h>
|
||||
#define HAVE_GETOPT_LONG 1
|
||||
#endif
|
||||
|
||||
#ifdef OS_CYGWIN
|
||||
|
||||
typedef void (*sighandler_t) (int);
|
||||
|
|
Loading…
Reference in a new issue