diff --git a/README b/README
index 83d16f040..65b9f0349 100644
--- a/README
+++ b/README
@@ -1,149 +1,32 @@
WELCOME TO GAMBAS!
-GAMBAS is a free implementation of a graphical development
-environment based on a BASIC interpreter. It is very
+GAMBAS is a free implementation of a graphical development environment
+based on a BASIC interpreter and a full development platform. It is very
inspired by Visual Basic and Java.
-More information on http://gambas.sourceforge.net
+Go to http://gambas.sourceforge.net to get more information: how to compile
+and install it, where to find binary packages, how to report a bug...
+Go to http://gambasdoc.org for language documentation.
-** IMPORTANT NOTES
+The following pieces of code were borrowed and adapted:
-Before downloading Gambas, compiling it and then complaining, please read the
-following remarks CAREFULLY!
+- The natural string comparison algorithme was adapted from the algorithm
+ made by Martin Pol. See http://sourcefrog.net/projects/natsort/ for more
+ details.
-To compile Gambas, you must install the following libraries on your system :
-
-+=================================+==========================================+
-| COMPONENTS | LIBRARIES |
-+=================================+==========================================+
-| gb.compress.bzlib2 | libbz2.so |
-+---------------------------------+------------------------------------------+
-| gb.compress.zlib | libz.so |
-+---------------------------------+------------------------------------------+
-| gb.corba | libACE.so libomniORB4.so |
-| | libomniDynamic4.so |
-+---------------------------------+------------------------------------------+
-| gb.crypt | libcrypt.so |
-+---------------------------------+------------------------------------------+
-| gb.db.firebird | libibpp.so libfbclient.so |
-+---------------------------------+------------------------------------------+
-| gb.db.mysql | libmysqlclient.so libz.so |
-+---------------------------------+------------------------------------------+
-| gb.db.odbc | libodbc.so |
-+---------------------------------+------------------------------------------+
-| gb.db.postgresql | libpq.so |
-+---------------------------------+------------------------------------------+
-| gb.db.sqlite | libsqlite.so |
-+---------------------------------+------------------------------------------+
-| gb.db.sqlite3 | libsqlite3.so |
-+---------------------------------+------------------------------------------+
-| gb.gtk | All GTK+ libraries |
-+---------------------------------+------------------------------------------+
-| gb.ldap | libldap.so |
-+---------------------------------+------------------------------------------+
-| gb.net | - |
-+---------------------------------+------------------------------------------+
-| gb.net.curl | libcurl.so |
-+---------------------------------+------------------------------------------+
-| gb.opengl | libGL.so libGLU.so |
-+---------------------------------+------------------------------------------+
-| gb.pcre | libpcre.so |
-+---------------------------------+------------------------------------------+
-| gb.qt | libqt-mt.so.3 |
-+---------------------------------+------------------------------------------+
-| gb.qt.kde | All KDE libraries |
-+---------------------------------+------------------------------------------+
-| gb.sdl | libSDL.so |
-+---------------------------------+------------------------------------------+
-| gb.sdl.sound | libSDL.so libSDL_mixer.so |
-+---------------------------------+------------------------------------------+
-| gb.sdl.image | libSDL.so libSDL_image.so libSDL_gfx.so |
-| | libSDL_ttf.so |
-+---------------------------------+------------------------------------------+
-| gb.sdl.opengl | libSDL.so libGL.so libGLU.so |
-+---------------------------------+------------------------------------------+
-| gb.v4l | libjpeg.so libpng.so video4linux >= 2.0 |
-+---------------------------------+------------------------------------------+
-| gb.xml | libxml-2.0 |
-+---------------------------------+------------------------------------------+
-| gb.xml.xslt | libxslt |
-+---------------------------------+------------------------------------------+
+- The hash table implementation was adapted from the glib one.
-And you must install all related development packages.
+- The HTML entities parsing in gb.gtk comes from KHTML sources.
-Try to always use a recent version of these libraries.
+- The gb.net.smtp component is a debugged and reworked version of an
+ unmaintained library made by Kevin Read in 2002.
-You must of course install the GCC compiler.
+- The gb.image.effect sources are adapted from KDE 3 image effect routines.
-You must compile gb.qt and gb.qt.ext components to have a working development
-environment.
+If I forget some borrowed code in the list above, just tell me.
-Qt 3.2 is now required because of one Qt function that was missing in older
-versions of Qt. Gambas will compile with Qt 3.1, but the function Picture.Copy()
-will fail in some case. Gambas does not compile with previous versions of Qt.
+Enjoy Gambas!
-You must have the right to write to /tmp, otherwise Gambas will not work.
-
-This package was done with the following versions of GNU tools:
- - automake 1.9.4
- - autoconf 2.59
- - libtool 1.5.12 (this tool is not required as it is included in the package)
-
-Each sub-directory of this source package is actually independent. You can
-configure, make and install each of them independently.
-
-
-** DISTRIBUTION SPECIFIC PROBLEMS
-
-Read the README.REDHAT or README.FEDORA files.
-
-
-** HOW TO COMPILE GAMBAS ?
-
-1) First, check that you installed all the needed development packages
-
-2) When done, type the following magic sentences in a shell.
- '#' represents your shell prompt, and "..." are the
- messages printed during the configuration and compilation.
-
- This command analyzes the system and configure the package:
-
- # ./configure -C
- ...
-
- This command compiles the programs:
-
- # make
- ...
-
- And finally this command installs everything:
-
- # su -c "make install"
- Password:
- ...
-
- If something fails during this process, try to type the
- following command before ./configure :
-
- # ./reconf
-
- If it does not work, I need to know what happened exactly.
- To do so, type the following command :
-
- # ( ./configure; make; make install ) > output.txt 2>&1
-
- And send me the file "output.txt" by mail, with every other
- detail about your computer and your distribution you find
- useful.
-
-3) If everything was fine, type "gambas2" to run the development
- environment. There are a few examples in the "examples"
- directory.
-
-4) There are more 'configure' specific explanations in the "INSTALL" file.
- I invite you to read them.
-
-Enjoy it !
-
-Benoît.
+--
+Benoît
\ No newline at end of file
diff --git a/app/src/gambas3/.lang/.pot b/app/src/gambas3/.lang/.pot
index 191147a74..234333c8a 100644
--- a/app/src/gambas3/.lang/.pot
+++ b/app/src/gambas3/.lang/.pot
@@ -369,19 +369,19 @@ msgstr ""
msgid "Thanks to"
msgstr ""
-#: FAbout.class:494
+#: FAbout.class:500
msgid "About Gambas..."
msgstr ""
-#: FAbout.class:502
+#: FAbout.class:508
msgid "About"
msgstr ""
-#: FAbout.class:519
+#: FAbout.class:525
msgid "Gambas Almost Means Basic!"
msgstr ""
-#: FAbout.class:532
+#: FAbout.class:538
msgid ""
"Licence
\n"
"\n"
@@ -396,37 +396,41 @@ msgid ""
"Public License for more details.
\n"
msgstr ""
-#: FAbout.class:538
+#: FAbout.class:544
msgid "Authors
\n"
msgstr ""
-#: FAbout.class:562
+#: FAbout.class:568
msgid "Make a gift!"
msgstr ""
-#: FAbout.class:566
+#: FAbout.class:572
msgid "Hall Of Fame"
msgstr ""
-#: FAbout.class:580
+#: FAbout.class:586
msgid "System information"
msgstr ""
-#: FAbout.class:593 FConflict.class:25 FFindList.class:203
+#: FAbout.class:597 FList.class:310 FMain.class:2299
+msgid "&Copy"
+msgstr ""
+
+#: FAbout.class:605 FConflict.class:25 FFindList.class:203
#: FIconEditor.class:1412 FImportTable.class:656 FInfo.class:427
#: FMakeInstall.class:260 FOption.class:1211 FTips.class:232
msgid "Close"
msgstr ""
-#: FAbout.class:611 FWelcome.class:513
+#: FAbout.class:623 FWelcome.class:513
msgid "Gambas"
msgstr ""
-#: FAbout.class:628 FWelcome.class:525
+#: FAbout.class:640 FWelcome.class:525
msgid "http://gambas.sourceforge.net"
msgstr ""
-#: FAbout.class:635
+#: FAbout.class:647
msgid "(c) 2000-2007 Benoît Minisini"
msgstr ""
@@ -1986,10 +1990,6 @@ msgstr ""
msgid "Cl&ear"
msgstr ""
-#: FList.class:310 FMain.class:2299
-msgid "&Copy"
-msgstr ""
-
#: FList.class:316 FMain.class:2306
msgid "&Paste"
msgstr ""
diff --git a/app/src/gambas3/.src/FAbout.class b/app/src/gambas3/.src/FAbout.class
index a17d165c9..5b418a0ab 100644
--- a/app/src/gambas3/.src/FAbout.class
+++ b/app/src/gambas3/.src/FAbout.class
@@ -452,8 +452,13 @@ Public Sub tabAbout_Click()
Copy "report-ng.sh" To sTemp
Shell "chmod a+x " & Shell$(sTemp) Wait
Exec [sTemp] To txtInfo.Text
- Clipboard.Copy(txtInfo.Text)
Endif
End
+
+Public Sub btnCopy_Click()
+
+ Clipboard.Copy(txtInfo.Text)
+
+End
diff --git a/app/src/gambas3/.src/FAbout.form b/app/src/gambas3/.src/FAbout.form
index 47a91904b..72c812918 100644
--- a/app/src/gambas3/.src/FAbout.form
+++ b/app/src/gambas3/.src/FAbout.form
@@ -82,11 +82,16 @@
Index = 2
Text = ("System information")
{ txtInfo TextArea
- MoveScaled(1,1,77,42)
+ MoveScaled(1,6,77,37)
Font = Font["Monospace"]
Text = ("")
ReadOnly = True
}
+ { btnCopy Button
+ MoveScaled(1,1,15,4)
+ Text = ("&Copy")
+ Picture = Picture["icon:/small/copy"]
+ }
Index = 0
}
{ btnClose Button
diff --git a/comp/src/gb.web/.project b/comp/src/gb.web/.project
index 5f0f658ff..3eabef6b5 100644
--- a/comp/src/gb.web/.project
+++ b/comp/src/gb.web/.project
@@ -1,5 +1,5 @@
# Gambas Project File 3.0
-# Compiled with Gambas 2.99.0 (r2485)
+# Compiled with Gambas 2.99.0 (r2637)
Title=gb.web
Startup=Main
Version=2.99.0
diff --git a/comp/src/gb.web/.src/Response.module b/comp/src/gb.web/.src/Response.module
index 60c6b20c7..e01a0f0f9 100644
--- a/comp/src/gb.web/.src/Response.module
+++ b/comp/src/gb.web/.src/Response.module
@@ -82,6 +82,7 @@ Public Sub Begin()
Else
Print $sHeader
+ $sHeader = ""
Endif
@@ -103,6 +104,7 @@ Public Sub End()
AddHeader("Content-Length", Lof($hFile))
Print $sHeader
+ $sHeader = ""
While Not Eof($hFile)
sBuffer = Read #$hFile, -4096
diff --git a/configure.ac b/configure.ac
index 7486c047e..98c6abae3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,7 +64,7 @@ AC_OUTPUT(Makefile)
GB_SUMMARY=""
for comp in gb.*; do
if test -e $comp/DISABLED; then
- GB_SUMMARY="$GB_SUMMARY$'\n'- $comp"
+ GB_SUMMARY="$GB_SUMMARY"$'\n'"- $comp"
fi
done
diff --git a/gb.net.smtp/README b/gb.net.smtp/README
index 86ab27f72..1b83a53ff 100644
--- a/gb.net.smtp/README
+++ b/gb.net.smtp/README
@@ -12,7 +12,7 @@ If you want the origianl, you can find it at:
http://libsmtp.berlios.de/
--
-Benoît.
+Benoît.
diff --git a/gb.qt4/src/CTextArea.cpp b/gb.qt4/src/CTextArea.cpp
index b6113fc0e..7ab2b1fb4 100644
--- a/gb.qt4/src/CTextArea.cpp
+++ b/gb.qt4/src/CTextArea.cpp
@@ -385,7 +385,9 @@ END_PROPERTY
BEGIN_METHOD_VOID(CTEXTAREA_sel_clear)
- WIDGET->textCursor().clearSelection();
+ QTextCursor cursor = WIDGET->textCursor();
+ cursor.clearSelection();
+ WIDGET->setTextCursor(cursor);
END_METHOD
@@ -407,6 +409,8 @@ BEGIN_METHOD(CTEXTAREA_sel_select, GB_INTEGER start; GB_INTEGER length)
cursor.setPosition(VARG(start));
cursor.setPosition(VARG(start) + VARG(length), QTextCursor::KeepAnchor);
+
+ WIDGET->setTextCursor(cursor);
}
END_METHOD
@@ -414,7 +418,9 @@ END_METHOD
BEGIN_METHOD_VOID(CTEXTAREA_sel_all) //, GB_BOOLEAN sel)
- WIDGET->textCursor().select(QTextCursor::Document);
+ QTextCursor cursor = WIDGET->textCursor();
+ cursor.select(QTextCursor::Document);
+ WIDGET->setTextCursor(cursor);
END_METHOD
diff --git a/gb.qt4/src/CTreeView.cpp b/gb.qt4/src/CTreeView.cpp
index 3abd72baa..994d02012 100644
--- a/gb.qt4/src/CTreeView.cpp
+++ b/gb.qt4/src/CTreeView.cpp
@@ -776,7 +776,7 @@ END_PROPERTY
BEGIN_PROPERTY(CTREEVIEW_count)
- GB.ReturnInteger(WIDGET->childCount());
+ GB.ReturnInteger(THIS->dict->count());
END_PROPERTY
diff --git a/main/gbx/gb_error.c b/main/gbx/gb_error.c
index 87bfa4c73..4ca088f0d 100644
--- a/main/gbx/gb_error.c
+++ b/main/gbx/gb_error.c
@@ -213,8 +213,11 @@ void ERROR_leave(ERROR_CONTEXT *err)
#if DEBUG_ERROR
fprintf(stderr, "ERROR_leave: (%p)\n", ERROR_current);
#endif
- ERROR_reset(&ERROR_current->info);
- ERROR_current->info = err->info;
+ if (err->info.code)
+ {
+ ERROR_reset(&ERROR_current->info);
+ ERROR_current->info = err->info;
+ }
}
else
ERROR_reset(&err->info);
diff --git a/main/gbx/gbx_compare.c b/main/gbx/gbx_compare.c
index 08fffa866..ee3e2c012 100644
--- a/main/gbx/gbx_compare.c
+++ b/main/gbx/gbx_compare.c
@@ -283,7 +283,7 @@ static int strnatcmp_compare_left(const char *a, int la, const char *b, int lb)
return 0;
}
-int COMPARE_string_natural(const char *a, int la, const char *b, int lb, bool nocase, bool lang)
+int COMPARE_string_natural(const char *a, int la, const char *b, int lb, bool nocase)
{
int ai, bi, lca, lcb;
unsigned char ca, cb;
@@ -342,31 +342,29 @@ int COMPARE_string_natural(const char *a, int la, const char *b, int lb, bool no
return 0;
}
- if (lang)
+ lca = STRING_get_utf8_char_length(ca);
+ lcb = STRING_get_utf8_char_length(cb);
+ if (lca > 1 || lcb > 1)
{
- lca = STRING_get_utf8_char_length(ca);
- lcb = STRING_get_utf8_char_length(cb);
- if (lca > 1 || lcb > 1)
+ if ((result = COMPARE_string_lang(&a[ai], lca, &b[bi], lcb, nocase, FALSE)))
+ return result;
+ ai += lca;
+ bi += lcb;
+ }
+ else
+ {
+ if (nocase)
{
- if ((result = COMPARE_string_lang(&a[ai], lca, &b[bi], lcb, nocase, FALSE)))
- return result;
- ai += lca;
- bi += lcb;
- continue;
+ ca = toupper(ca);
+ cb = toupper(cb);
}
+
+ if (ca < cb)
+ return -1;
+ else if (ca > cb)
+ return +1;
+ ++ai; ++bi;
}
-
- if (nocase)
- {
- ca = toupper(ca);
- cb = toupper(cb);
- }
-
- if (ca < cb)
- return -1;
- else if (ca > cb)
- return +1;
- ++ai; ++bi;
}
}
@@ -409,7 +407,12 @@ static int compare_string_lang_case(char **pa, char **pb)
int COMPARE_string_like(const char *s1, int l1, const char *s2, int l2)
{
- return REGEXP_match(s2, l2, s1, l1) ? 0 : TABLE_compare_ignore_case(s1, l1, s2, l2);
+ int result;
+
+ if (REGEXP_match(s2, l2, s1, l1))
+ return 0;
+ result = TABLE_compare_ignore_case(s1, l1, s2, l2);
+ return (result < 0) ? -1 : (result > 0) ? 1 : 0;
}
static int compare_string_like(char **pa, char **pb)
@@ -420,18 +423,16 @@ static int compare_string_like(char **pa, char **pb)
//return REGEXP_match(*pb, lb, *pa, la) ? 0 : TABLE_compare_ignore_case(*pa, la, *pb, lb);
}
-#define IMPLEMENT_COMPARE_STRING_NATURAL(_name, _nocase, _lang) \
+#define IMPLEMENT_COMPARE_STRING_NATURAL(_name, _nocase) \
static int compare_string_##_name(char **pa, char **pb) \
{ \
int la = *pa ? strlen(*pa) : 0; \
int lb = *pb ? strlen(*pb) : 0; \
- return COMPARE_string_natural(*pa, la, *pb, lb, _nocase, _lang); \
+ return COMPARE_string_natural(*pa, la, *pb, lb, _nocase); \
}
-IMPLEMENT_COMPARE_STRING_NATURAL(natural, FALSE, FALSE)
-IMPLEMENT_COMPARE_STRING_NATURAL(natural_case, TRUE, FALSE)
-IMPLEMENT_COMPARE_STRING_NATURAL(natural_lang, FALSE, TRUE)
-IMPLEMENT_COMPARE_STRING_NATURAL(natural_lang_case, TRUE, TRUE)
+IMPLEMENT_COMPARE_STRING_NATURAL(natural, FALSE)
+IMPLEMENT_COMPARE_STRING_NATURAL(natural_case, TRUE)
int COMPARE_object(void **a, void **b)
{
@@ -506,18 +507,15 @@ COMPARE_FUNC COMPARE_get(TYPE type, int mode)
return (COMPARE_FUNC)compare_date;
case T_STRING:
- switch(mode)
- {
- case GB_COMP_LANG | GB_COMP_TEXT: return (COMPARE_FUNC)compare_string_lang_case;
- case GB_COMP_LANG: return (COMPARE_FUNC)compare_string_lang;
- case GB_COMP_TEXT: return (COMPARE_FUNC)compare_string_case;
- case GB_COMP_LIKE: return (COMPARE_FUNC)compare_string_like;
- case GB_COMP_NATURAL: return (COMPARE_FUNC)compare_string_natural;
- case GB_COMP_NATURAL | GB_COMP_TEXT: return (COMPARE_FUNC)compare_string_natural_case;
- case GB_COMP_NATURAL | GB_COMP_LANG: return (COMPARE_FUNC)compare_string_natural_lang;
- case GB_COMP_NATURAL | GB_COMP_LANG | GB_COMP_TEXT: return (COMPARE_FUNC)compare_string_natural_lang_case;
- default: return (COMPARE_FUNC)compare_string_binary;
- }
+
+ if (mode & GB_COMP_NATURAL)
+ return (COMPARE_FUNC)((mode & GB_COMP_TEXT) ? compare_string_natural_case : compare_string_natural);
+ else if (mode & GB_COMP_LIKE)
+ return (COMPARE_FUNC)compare_string_like;
+ else if (mode & GB_COMP_LANG)
+ return (COMPARE_FUNC)((mode & GB_COMP_TEXT) ? compare_string_lang_case : compare_string_lang);
+ else
+ return (COMPARE_FUNC)((mode & GB_COMP_TEXT) ? compare_string_case : compare_string_binary);
default:
return (COMPARE_FUNC)compare_nothing;
diff --git a/main/gbx/gbx_compare.h b/main/gbx/gbx_compare.h
index a2bb7016e..af7431355 100644
--- a/main/gbx/gbx_compare.h
+++ b/main/gbx/gbx_compare.h
@@ -46,7 +46,7 @@ COMPARE_FUNC COMPARE_get(TYPE type, int mode);
int COMPARE_object(void **a, void **b);
int COMPARE_string_lang(const char *s1, int l1, const char *s2, int l2, bool nocase, bool throw);
int COMPARE_string_like(const char *s1, int l1, const char *s2, int l2);
-int COMPARE_string_natural(const char *a, int la, const char *b, int lb, bool nocase, bool lang);
+int COMPARE_string_natural(const char *a, int la, const char *b, int lb, bool nocase);
#endif
#endif
diff --git a/main/gbx/gbx_exec.c b/main/gbx/gbx_exec.c
index 88ad8c116..8f0b1403b 100644
--- a/main/gbx/gbx_exec.c
+++ b/main/gbx/gbx_exec.c
@@ -848,9 +848,11 @@ void EXEC_function_loop()
fprintf(stderr, "#3\n");
fprintf(stderr, "NOTHING\n");
#endif
+ //ERROR_INFO save = { 0 };
+ //ERROR_save(&save);
ERROR_set_last();
-
+
if (EXEC_debug && !STACK_has_error_handler())
{
if (TP && TC)
@@ -882,11 +884,10 @@ void EXEC_function_loop()
{
/*printf("try to propagate\n");*/
STACK_pop_frame(&EXEC_current);
+
+ //ERROR_restore(&save);
+ //ERROR_set_last();
PROPAGATE();
-
- /*ERROR_print();
- exit(1);*/
- /*retry = FALSE;*/
}
if (EP != NULL)
@@ -909,6 +910,9 @@ void EXEC_function_loop()
retry = TRUE;
}
+
+ //ERROR_restore(&save);
+ //ERROR_set_last();
}
while (SP < EXEC_super)
diff --git a/main/gbx/gbx_exec_loop.c b/main/gbx/gbx_exec_loop.c
index 15aebeb8f..75a603f20 100644
--- a/main/gbx/gbx_exec_loop.c
+++ b/main/gbx/gbx_exec_loop.c
@@ -1578,7 +1578,7 @@ _END_TRY:
fprintf(stderr, "exec END TRY %p\n", PC);
#endif
- /* If EP was reset to null, then there was an error */
+ // If EP was reset to null, then an error occurred
EXEC_got_error = (EP == NULL);
EP = NULL;
EC = ET;
diff --git a/main/gbx/gbx_subr_test.c b/main/gbx/gbx_subr_test.c
index 5cc1cbc5e..64162d695 100644
--- a/main/gbx/gbx_subr_test.c
+++ b/main/gbx/gbx_subr_test.c
@@ -664,7 +664,7 @@ void SUBR_strcomp(void)
SUBR_get_string_len(&PARAM[1], &s2, &l2);
if (mode & GB_COMP_NATURAL)
- ret = COMPARE_string_natural(s1, l1, s2, l2, mode & GB_COMP_TEXT, mode & GB_COMP_LANG);
+ ret = COMPARE_string_natural(s1, l1, s2, l2, mode & GB_COMP_TEXT);
else if (mode & GB_COMP_LIKE)
ret = COMPARE_string_like(s1, l1, s2, l2);
else if (mode & GB_COMP_LANG)