From 7ecc12bfe8bd1e3f632ef660048a41c496be41d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Wed, 28 Mar 2012 21:55:19 +0000 Subject: [PATCH] [GB.GTK] * BUG: Do not try to change the background color of menus. It breaks GTK+ widget style like Ambiance. [GB.WEB] * BUG: Setting a Request value to NULL now works as expected. git-svn-id: svn://localhost/gambas/trunk@4573 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- comp/src/gb.web/.src/Main.module | 6 +++- comp/src/gb.web/.src/Request.module | 10 ++++-- examples/examples/Sound/MusicPlayer/.project | 4 +-- gb.gtk/src/gmenu.cpp | 22 +++++++------ main/gbx/gbx.c | 6 ++++ main/gbx/gbx_exec_loop.c | 34 ++++++++++++++++++++ 6 files changed, 67 insertions(+), 15 deletions(-) diff --git a/comp/src/gb.web/.src/Main.module b/comp/src/gb.web/.src/Main.module index 6e5111127..61be97b2f 100644 --- a/comp/src/gb.web/.src/Main.module +++ b/comp/src/gb.web/.src/Main.module @@ -54,7 +54,11 @@ Public Sub DecodeURL(sUrl As String, aField As String[], cVal As Collection) Endif Next - + +' Catch +' +' Error.Raise("Malformed URL:" & Error.Where & ": " & Error.Text) +' End diff --git a/comp/src/gb.web/.src/Request.module b/comp/src/gb.web/.src/Request.module index d9b453404..e15db0572 100644 --- a/comp/src/gb.web/.src/Request.module +++ b/comp/src/gb.web/.src/Request.module @@ -16,6 +16,7 @@ Property Read Post As _Request_Post Private $cCookies As Collection Private $cVal As Collection +Private $cKey As Collection Private $aField As String[] Private $iMaxLength As Integer Private $sBuffer As String @@ -45,7 +46,7 @@ Public Sub _get(Key As String) As String Dim sVal As String - If $cVal And If $cVal.Exist(Key) Then Return $cVal[Key] + If $cKey And If $cKey.Exist(Key) Then Return $cVal[Key] Decode @@ -60,8 +61,13 @@ End Public Sub _put(Value As String, Key As String) - If Not $cVal Then $cVal = New Collection + If Not $cVal Then + $cVal = New Collection + $cKey = New Collection + Endif + $cVal[Key] = Value + $cKey[Key] = True End diff --git a/examples/examples/Sound/MusicPlayer/.project b/examples/examples/Sound/MusicPlayer/.project index cce3973aa..38832b282 100644 --- a/examples/examples/Sound/MusicPlayer/.project +++ b/examples/examples/Sound/MusicPlayer/.project @@ -1,9 +1,9 @@ # Gambas Project File 3.0 -# Compiled with Gambas 3.0.0 +# Compiled with Gambas 3.0.90 Title=Gambas Music Player Startup=FSoundPlayer Icon=sound.png -Version=3.0.0 +Version=3.0.90 VersionFile=1 Component=gb.image Component=gb.gui diff --git a/gb.gtk/src/gmenu.cpp b/gb.gtk/src/gmenu.cpp index dbe607af6..a28131ad4 100644 --- a/gb.gtk/src/gmenu.cpp +++ b/gb.gtk/src/gmenu.cpp @@ -223,8 +223,8 @@ void gMenu::update() { gMainWindow *win = (gMainWindow *)pr; - set_gdk_fg_color(GTK_WIDGET(menu), win->foreground()); - set_gdk_bg_color(GTK_WIDGET(menu), win->background()); + //set_gdk_fg_color(GTK_WIDGET(menu), win->foreground()); + //set_gdk_bg_color(GTK_WIDGET(menu), win->background()); //gtk_menu_shell_append(GTK_MENU_SHELL(win->menuBar), GTK_WIDGET(menu)); shell = GTK_MENU_SHELL(win->menuBar); @@ -244,6 +244,8 @@ void gMenu::update() if (parent->style() == MENU) gtk_menu_item_set_submenu(GTK_MENU_ITEM(parent->menu), GTK_WIDGET(parent->child)); + parent->setColor(); + //gtk_menu_shell_append(GTK_MENU_SHELL(parent->child), GTK_WIDGET(menu)); //g_debug("%p: add to new parent %p", this, parent->child); } @@ -798,13 +800,13 @@ void gMenu::setFont() void gMenu::setColor() { gMainWindow *win = window(); - if (child) + /*if (child) { - set_gdk_bg_color(GTK_WIDGET(child), win->realBackground()); - set_gdk_fg_color(GTK_WIDGET(child), win->realForeground()); - } - if (label) set_gdk_fg_color(GTK_WIDGET(label), win->realForeground()); - if (aclbl) set_gdk_fg_color(GTK_WIDGET(aclbl), win->realForeground()); + set_gdk_bg_color(GTK_WIDGET(child), win->background()); + set_gdk_fg_color(GTK_WIDGET(child), win->foreground()); + }*/ + if (label) set_gdk_fg_color(GTK_WIDGET(label), win->foreground()); + if (aclbl) set_gdk_fg_color(GTK_WIDGET(aclbl), win->foreground()); } void gMenu::updateColor(gMainWindow *win) @@ -815,7 +817,7 @@ void gMenu::updateColor(gMainWindow *win) if (!win->menuBar) return; - set_gdk_bg_color(GTK_WIDGET(win->menuBar), win->realBackground()); + set_gdk_bg_color(GTK_WIDGET(win->menuBar), win->background()); if (!menus) return; @@ -834,7 +836,7 @@ void gMenu::updateFont(gMainWindow *win) { GList *item; gMenu *mn; - + if (win->menuBar) { //fprintf(stderr, "set menu bar font\n"); diff --git a/main/gbx/gbx.c b/main/gbx/gbx.c index e5c5a8f3f..284281bd2 100644 --- a/main/gbx/gbx.c +++ b/main/gbx/gbx.c @@ -33,6 +33,8 @@ #include #include +#include +#include #include "gbx_class.h" #include "gbx_exec.h" @@ -185,6 +187,10 @@ int main(int argc, char **argv) //sprintf(log_path, "/tmp/gambas-%d.log", getuid()); //log_file = freopen(log_path, "w+", stderr); //fprintf(stderr, "Fichier log Gambas\n"); + + //struct rlimit rl = { 32000000, 32000000 }; + //if (setrlimit(RLIMIT_CORE, &rl)) + // perror(strerror(errno)); MEMORY_init(); COMMON_init(); diff --git a/main/gbx/gbx_exec_loop.c b/main/gbx/gbx_exec_loop.c index ab90add39..9375bc829 100644 --- a/main/gbx/gbx_exec_loop.c +++ b/main/gbx/gbx_exec_loop.c @@ -460,6 +460,23 @@ void EXEC_loop(void) _MAIN: +#if 0 + { + FILE *f; + + f = fopen("/var/log/thttpd/pcode.log", "a"); + if (f) + { + fprintf(f, "%s: ", DEBUG_get_current_position()); + if (*PC >> 8) + PCODE_dump(f, PC - FP->code, PC); + else + fprintf(f, "\n"); + fclose(f); + } + } +#endif + #if DEBUG_PCODE DEBUG_where(); fprintf(stderr, "[%4d] ", (int)(intptr_t)(SP - (VALUE *)STACK_base)); @@ -489,6 +506,23 @@ _NEXT: code = *(++PC); +#if 0 + { + FILE *f; + + f = fopen("/var/log/thttpd/pcode.log", "a"); + if (f) + { + fprintf(f, "%s: ", DEBUG_get_current_position()); + if (*PC >> 8) + PCODE_dump(f, PC - FP->code, PC); + else + fprintf(f, "\n"); + fclose(f); + } + } +#endif + #if DEBUG_PCODE DEBUG_where(); fprintf(stderr, "[%4d] ", (int)(intptr_t)(SP - (VALUE *)STACK_base));