diff --git a/app/src/gambas3/.lang/es.po b/app/src/gambas3/.lang/es.po index a61bde1a1..af7daf64b 100644 --- a/app/src/gambas3/.lang/es.po +++ b/app/src/gambas3/.lang/es.po @@ -10,6 +10,15 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +#: .project:1 +#, fuzzy +msgid "Gambas 3" +msgstr "Gambas" + +#: .project:2 +msgid "Integrated Development Environment for Gambas" +msgstr "" + #: CComponent.class:63 msgid "Internal native classes" msgstr "Clases nativas internas" @@ -110,7 +119,7 @@ msgstr "QT/GTK+ intercambio de componente" msgid "Image management" msgstr "Manejo de imágenes" -#: CComponent.class:88 FPropertyProject.class:2095 +#: CComponent.class:88 FPropertyProject.class:2077 msgid "Image loading and saving" msgstr "Cargado y guardado de imágenes" @@ -234,15 +243,15 @@ msgstr "Herramientas XSLT basadas en libxslt" msgid "Web applications tools" msgstr "Herramientas de aplicaciones web" -#: CComponent.class:120 FPropertyProject.class:2034 +#: CComponent.class:120 FPropertyProject.class:2015 msgid "Graphical form management" msgstr "Gestión gráfica de formularios" -#: CComponent.class:121 FPropertyProject.class:2040 +#: CComponent.class:121 FPropertyProject.class:2021 msgid "Event loop management" msgstr "Gestión del bucle de eventos" -#: CComponent.class:123 FPropertyProject.class:2052 +#: CComponent.class:123 FPropertyProject.class:2033 msgid "OpenGL display" msgstr "Display OpenGL" @@ -254,7 +263,7 @@ msgstr "Cargando información en componente &1..." msgid "Experimental" msgstr "Experimental" -#: CComponentBox.class:91 FPropertyProject.class:1661 +#: CComponentBox.class:91 FPropertyProject.class:1658 msgid "Not finished but stable" msgstr "No terminado pero estable" @@ -262,7 +271,7 @@ msgstr "No terminado pero estable" msgid "Authors" msgstr "Autores" -#: CComponentBox.class:204 FPropertyProject.class:2063 +#: CComponentBox.class:204 FPropertyProject.class:2044 msgid "Requires" msgstr "Requiere" @@ -274,7 +283,7 @@ msgstr "Excluir" msgid "Implements" msgstr "Implementa" -#: CComponentBox.class:225 FPropertyProject.class:2010 +#: CComponentBox.class:225 FPropertyProject.class:1991 msgid "Provides" msgstr "Provee" @@ -480,7 +489,7 @@ msgid "Paste" msgstr "Pegar" #: FCommit.class:236 FConflict.class:348 FEditor.class:2906 FForm.class:3507 -#: FIconEditor.class:2150 FOption.class:1102 FOutput.class:458 +#: FIconEditor.class:2150 FOption.class:1103 FOutput.class:458 #: FTextEditor.class:873 msgid "Undo" msgstr "Deshacer" @@ -509,7 +518,7 @@ msgid "&Edit" msgstr "&Editar" #: FConflict.class:25 FFindList.class:169 FIconEditor.class:1412 -#: FInfo.class:408 FMakeInstall.class:250 FOption.class:1123 FTips.class:232 +#: FInfo.class:408 FMakeInstall.class:250 FOption.class:1124 FTips.class:232 msgid "Close" msgstr "Cerrar" @@ -640,7 +649,7 @@ msgid "Name" msgstr "Nombre" #: FCreateFile.class:734 FCreateProject.class:526 FMakeExecutable.class:98 -#: FOption.class:920 FPropertyProject.class:1615 +#: FOption.class:921 FPropertyProject.class:1612 msgid "Options" msgstr "Opciones" @@ -801,7 +810,7 @@ msgstr "Información del proyecto" msgid "Identification" msgstr "Identificación" -#: FCreateProject.class:646 FPropertyProject.class:1550 +#: FCreateProject.class:646 FPropertyProject.class:1547 msgid "Title" msgstr "Título" @@ -1036,7 +1045,7 @@ msgstr "División vertical" msgid "Save" msgstr "Guardar" -#: FEditor.class:3055 FOption.class:902 +#: FEditor.class:3055 FOption.class:903 msgid "Editor" msgstr "Editor" @@ -1124,7 +1133,7 @@ msgstr "Buscar en los comentarios" msgid "Search in strings" msgstr "Buscar en cadenas" -#: FFindList.class:49 FIconEditor.class:2278 FOption.class:1028 +#: FFindList.class:49 FIconEditor.class:2278 FOption.class:1029 msgid "Line" msgstr "Línea" @@ -1518,11 +1527,11 @@ msgstr "¿Quiere limpiar la lista de valores?" msgid "Edit list property" msgstr "Editar lista de propiedades" -#: FList.class:179 FMenu.class:824 FPropertyProject.class:1903 +#: FList.class:179 FMenu.class:824 FPropertyProject.class:1884 msgid "&Insert" msgstr "&Insertar" -#: FList.class:197 FMenu.class:830 FTranslate.class:1606 +#: FList.class:197 FMenu.class:830 FTranslate.class:1607 msgid "&Delete" msgstr "&Borrar" @@ -1868,7 +1877,7 @@ msgstr "Propiedades del proyecto" msgid "Refresh project" msgstr "Refrescar proyecto" -#: FMain.class:2201 FOption.class:632 +#: FMain.class:2201 FOption.class:633 msgid "Preferences" msgstr "Preferencias" @@ -2105,7 +2114,7 @@ msgstr "Su dirección de correo electrónico" msgid "Vendor name" msgstr "Nombre del vendedor" -#: FMakeInstall.class:1096 FPropertyProject.class:1539 +#: FMakeInstall.class:1096 FPropertyProject.class:1536 msgid "Description" msgstr "Descripción" @@ -2197,11 +2206,11 @@ msgstr "Dependencias extra" msgid "Same dependencies for all targets" msgstr "Mismas dependencias para todos los paquetes" -#: FMakeInstall.class:1382 FPropertyProject.class:2133 +#: FMakeInstall.class:1382 FPropertyProject.class:2115 msgid "&Add" msgstr "&Agregar" -#: FMakeInstall.class:1388 FPropertyProject.class:1909 +#: FMakeInstall.class:1388 FPropertyProject.class:1890 msgid "&Remove" msgstr "&Eliminar" @@ -2323,7 +2332,7 @@ msgstr "Marcado" msgid "Click on Insert to add a new menu." msgstr "Haga click en Insertar para añadir un menú nuevo." -#: FNewTranslation.class:59 FTranslate.class:1591 +#: FNewTranslation.class:59 FTranslate.class:1592 msgid "New translation" msgstr "Nueva traducción" @@ -2391,7 +2400,7 @@ msgstr "Seleccione un tema" msgid "Desktop" msgstr "Escritorio" -#: FOption.class:57 FPropertyProject.class:57 +#: FOption.class:57 msgid "(Default)" msgstr "(Por defecto)" @@ -2407,171 +2416,171 @@ msgstr "Archivos de temas de resaltado de Gambas" msgid "Export a theme file" msgstr "Exportar un archivo de tema" -#: FOption.class:266 +#: FOption.class:267 msgid "Select a theme file" msgstr "Seleccione un archivo de tema" -#: FOption.class:296 +#: FOption.class:297 msgid "You need to restart the application to see your changes." msgstr "Necesita reiniciar la aplicación para ver los cambios." -#: FOption.class:644 +#: FOption.class:645 msgid "Foreground color..." msgstr "Color de fuente..." -#: FOption.class:648 +#: FOption.class:649 msgid "Background color..." msgstr "Color de fondo..." -#: FOption.class:656 +#: FOption.class:657 msgid "Bold" msgstr "Negrita" -#: FOption.class:660 +#: FOption.class:661 msgid "Italic" msgstr "Cursiva" -#: FOption.class:664 +#: FOption.class:665 msgid "Underline" msgstr "Subrayado" -#: FOption.class:673 FPropertyProject.class:1534 +#: FOption.class:674 FPropertyProject.class:1531 msgid "General" msgstr "General" -#: FOption.class:681 +#: FOption.class:682 msgid "Icon theme" msgstr "Tema de los iconos" -#: FOption.class:699 +#: FOption.class:700 msgid "Browser" msgstr "Navegador" -#: FOption.class:720 +#: FOption.class:721 msgid "Interface" msgstr "Interface" -#: FOption.class:729 +#: FOption.class:730 msgid "Show tooltips" msgstr "Mostrar consejos" -#: FOption.class:736 FPropertyProject.class:1678 +#: FOption.class:737 FPropertyProject.class:1675 msgid "No" msgstr "No" -#: FOption.class:736 FPropertyProject.class:1678 +#: FOption.class:737 FPropertyProject.class:1675 msgid "Yes" msgstr "Sí" -#: FOption.class:746 +#: FOption.class:747 msgid "Show message bar" msgstr "Mostrar barra de mensajes" -#: FOption.class:763 +#: FOption.class:764 msgid "Font size" msgstr "Tamaño de la fuente" -#: FOption.class:771 +#: FOption.class:772 msgid "Normal" msgstr "Normal" -#: FOption.class:771 +#: FOption.class:772 msgid "Small" msgstr "Pequeño" -#: FOption.class:781 +#: FOption.class:782 msgid "Toolbox size" msgstr "Tamaño de la caja de herramientas" -#: FOption.class:799 +#: FOption.class:800 msgid "Sort properties" msgstr "Ordenar propiedades" -#: FOption.class:816 FWelcome.class:47 +#: FOption.class:817 FWelcome.class:47 msgid "Recent projects" msgstr "Proyectos recientes" -#: FOption.class:829 +#: FOption.class:830 msgid "Max." msgstr "Máximo." -#: FOption.class:839 +#: FOption.class:840 msgid "Quiet external commands" msgstr "Comandos externos ocultos" -#: FOption.class:856 +#: FOption.class:857 msgid "Display property help" msgstr "Mostrar ayuda de propiedades" -#: FOption.class:873 +#: FOption.class:874 msgid "Tabstrip font size" msgstr "Tamaño de fuente del Tabstrip" -#: FOption.class:881 +#: FOption.class:882 msgid "Tiny" msgstr "Delgada" -#: FOption.class:891 +#: FOption.class:892 msgid "Minimize at runtime" msgstr "Minimizar en tiempo de ejecución" -#: FOption.class:907 +#: FOption.class:908 msgid "Font" msgstr "Fuente" -#: FOption.class:929 +#: FOption.class:930 msgid "Automatic completion" msgstr "Autocompletado" -#: FOption.class:946 +#: FOption.class:947 msgid "Default tab size" msgstr "Tamaño del tabulador" -#: FOption.class:959 +#: FOption.class:960 msgid "spaces" msgstr "espacios" -#: FOption.class:969 +#: FOption.class:970 msgid "Show line numbers" msgstr "Mostrar números de línea" -#: FOption.class:986 +#: FOption.class:987 msgid "Highlight modified lines" msgstr "Resaltar líneas modificadas" -#: FOption.class:1003 +#: FOption.class:1004 msgid "Highlight current line" msgstr "Resaltar línea actual" -#: FOption.class:1020 +#: FOption.class:1021 msgid "Procedure separation" msgstr "Separación de procedimientos" -#: FOption.class:1028 +#: FOption.class:1029 msgid "Blend" msgstr "Combinar" -#: FOption.class:1028 FProperty.class:685 +#: FOption.class:1029 FProperty.class:685 msgid "None" msgstr "Ninguno" -#: FOption.class:1038 +#: FOption.class:1039 msgid "Fold procedures by default" msgstr "Plegar procedimientos por defecto" -#: FOption.class:1055 +#: FOption.class:1056 msgid "Keywords in upper case" msgstr "Palabras clave en mayúscula" -#: FOption.class:1066 +#: FOption.class:1067 msgid "Theme" msgstr "Tema" -#: FOption.class:1088 +#: FOption.class:1089 msgid "Import theme" msgstr "Importar tema" -#: FOption.class:1095 +#: FOption.class:1096 msgid "Export theme" msgstr "Exportar tema" @@ -2627,7 +2636,7 @@ msgstr "Pegar con PRINT" msgid "Clipboard contents" msgstr "Contenido del portapapeles" -#: FProjectItem.class:20 FPropertyProject.class:1562 +#: FProjectItem.class:20 FPropertyProject.class:1559 msgid "Author(s)" msgstr "Autor(es)" @@ -2707,155 +2716,151 @@ msgstr "No es posible escribir el archivo de descripción del componente." msgid "You are going to cancel your changes!" msgstr "¡Va a cancelar sus cambios!" -#: FPropertyProject.class:1596 +#: FPropertyProject.class:1593 msgid "Version" msgstr "Versión" -#: FPropertyProject.class:1620 +#: FPropertyProject.class:1617 msgid "Edition" msgstr "Edición" -#: FPropertyProject.class:1626 +#: FPropertyProject.class:1623 msgid "Compilation" msgstr "Compilación" -#: FPropertyProject.class:1632 +#: FPropertyProject.class:1629 msgid "Execution" msgstr "Ejecución" -#: FPropertyProject.class:1638 +#: FPropertyProject.class:1635 msgid "Component" msgstr "Componente" -#: FPropertyProject.class:1644 +#: FPropertyProject.class:1641 msgid "Translation" msgstr "Traducción" -#: FPropertyProject.class:1653 +#: FPropertyProject.class:1650 msgid "Component advancement" msgstr "Avance del componente" -#: FPropertyProject.class:1661 +#: FPropertyProject.class:1658 msgid "Beta version" msgstr "Versión Beta" -#: FPropertyProject.class:1661 +#: FPropertyProject.class:1658 msgid "Finished and stable" msgstr "Terminado y estable" -#: FPropertyProject.class:1671 +#: FPropertyProject.class:1668 msgid "This project is a component" msgstr "Este proyecto es un componente" -#: FPropertyProject.class:1688 -msgid "Stack size" -msgstr "Tamaño de la pila" - -#: FPropertyProject.class:1704 +#: FPropertyProject.class:1685 msgid "Default language" msgstr "Lenguaje por defecto" -#: FPropertyProject.class:1721 +#: FPropertyProject.class:1702 msgid "Project is translatable" msgstr "El proyecto es traducible" -#: FPropertyProject.class:1738 +#: FPropertyProject.class:1719 msgid "Get version from program" msgstr "Obtener versión desde un programa" -#: FPropertyProject.class:1754 +#: FPropertyProject.class:1735 msgid "Form controls are public" msgstr "Los controles de formulario son públicos" -#: FPropertyProject.class:1771 +#: FPropertyProject.class:1752 msgid "Module symbols are public by default" msgstr "Símbolos en módulos son públicos por defecto" -#: FPropertyProject.class:1788 +#: FPropertyProject.class:1769 msgid "Tab size" msgstr "Tamaño del tabulador" -#: FPropertyProject.class:1800 +#: FPropertyProject.class:1781 msgid "space(s)" msgstr "espacio(s)" -#: FPropertyProject.class:1810 +#: FPropertyProject.class:1791 msgid "Dump stack on error" msgstr "En error dump stack" -#: FPropertyProject.class:1824 +#: FPropertyProject.class:1805 msgid "Debugging" msgstr "Depurado" -#: FPropertyProject.class:1833 +#: FPropertyProject.class:1814 msgid "Use a terminal emulator" msgstr "Usar un emulador de terminal" -#: FPropertyProject.class:1844 +#: FPropertyProject.class:1825 msgid "Components" msgstr "Componentes" -#: FPropertyProject.class:1849 +#: FPropertyProject.class:1830 msgid "Show components in beta version" msgstr "Mostrar componentes en versión beta" -#: FPropertyProject.class:1854 +#: FPropertyProject.class:1835 msgid "Show only components used in project" msgstr "Mostrar sólo componentes usados en el proyecto" -#: FPropertyProject.class:1866 +#: FPropertyProject.class:1847 msgid "About &component..." msgstr "Acerca del &componente..." -#: FPropertyProject.class:1877 +#: FPropertyProject.class:1858 msgid "&Reset" msgstr "&Reiniciar" -#: FPropertyProject.class:1882 +#: FPropertyProject.class:1863 msgid "Environment" msgstr "Entorno" -#: FPropertyProject.class:1894 +#: FPropertyProject.class:1875 msgid "Arguments" msgstr "Argumentos" -#: FPropertyProject.class:1938 +#: FPropertyProject.class:1919 msgid "Environment variables" msgstr "Variables de Entorno" -#: FPropertyProject.class:1967 +#: FPropertyProject.class:1948 msgid "Versioning" msgstr "Versionado" -#: FPropertyProject.class:1975 +#: FPropertyProject.class:1956 msgid "Changes since last commit" msgstr "Cambios desde el último commit" -#: FPropertyProject.class:1992 +#: FPropertyProject.class:1973 msgid "&Update" msgstr "&Actualizar" -#: FPropertyProject.class:1998 +#: FPropertyProject.class:1979 msgid "&Revert..." msgstr "&Deshacer..." -#: FPropertyProject.class:2004 +#: FPropertyProject.class:1985 msgid "&Commit..." msgstr "&Commit..." -#: FPropertyProject.class:2046 +#: FPropertyProject.class:2027 msgid "Image provider" msgstr "Proveedor de imágenes" -#: FPropertyProject.class:2060 +#: FPropertyProject.class:2041 msgid "Exported classes" msgstr "Clases exportadas" -#: FPropertyProject.class:2074 +#: FPropertyProject.class:2055 msgid "Features" msgstr "Características" -#: FPropertyProject.class:2145 +#: FPropertyProject.class:2127 msgid "Remove All" msgstr "Eliminar todo" @@ -2959,119 +2964,119 @@ msgstr "Exportar una traducción" msgid "Translation files" msgstr "Archivos de traducción" -#: FTranslate.class:842 +#: FTranslate.class:843 msgid "Import a translation" msgstr "Importar una traducción" -#: FTranslate.class:869 +#: FTranslate.class:870 msgid "No translation were picked up." msgstr "No fue seleccionada ninguna traducción." -#: FTranslate.class:871 +#: FTranslate.class:872 msgid "One translation was picked up." msgstr "Una traducción fue seleccionada." -#: FTranslate.class:873 +#: FTranslate.class:874 msgid "&1 translations were picked up." msgstr "&1 traducciones fueron tomadas." -#: FTranslate.class:882 +#: FTranslate.class:883 msgid "Cannot import translation file." msgstr "No es posible importar el archivo de traducción." -#: FTranslate.class:934 +#: FTranslate.class:935 msgid "Translated string symbols do not match untranslated string ones." msgstr "Los símbolos de las cadenas traducidas no concuerdan con los de las cadenas sin traducir." -#: FTranslate.class:947 +#: FTranslate.class:948 msgid "Everything seems to be correct." msgstr "Todo parece estar correcto." -#: FTranslate.class:965 +#: FTranslate.class:966 msgid "&1 strings (&2 not translated) - &3 % done" msgstr "&1 cadenas (&2 sin traducir) - &3 % terminado" -#: FTranslate.class:1094 +#: FTranslate.class:1095 msgid "The 'msgmerge' command has failed" msgstr "El comando 'msgmerge' ha fallado" -#: FTranslate.class:1177 +#: FTranslate.class:1178 msgid "All files" msgstr "Todos los Archivos" -#: FTranslate.class:1388 +#: FTranslate.class:1389 msgid "Project translation" msgstr "Traducción del proyecto" -#: FTranslate.class:1437 +#: FTranslate.class:1438 msgid "Show statistics" msgstr "Mostrar estadísticas" -#: FTranslate.class:1477 +#: FTranslate.class:1478 msgid "Save translation" msgstr "Guardar traducción" -#: FTranslate.class:1484 +#: FTranslate.class:1485 msgid "Clear this translation" msgstr "Limpiar esta traducción" -#: FTranslate.class:1491 +#: FTranslate.class:1492 msgid "This string must not be translated" msgstr "La cadena no debe ser traducida" -#: FTranslate.class:1498 +#: FTranslate.class:1499 msgid "Copy untranslated string" msgstr "Copiar cadena no traducida" -#: FTranslate.class:1505 +#: FTranslate.class:1506 msgid "Verify the translation" msgstr "Verificar la traducción" -#: FTranslate.class:1512 +#: FTranslate.class:1513 msgid "Find next untranslated string" msgstr "Encontrar la siguiente cadena sin traducir" -#: FTranslate.class:1519 +#: FTranslate.class:1520 msgid "Find previous untranslated string" msgstr "Encontrar la cadena sin traducción previa" -#: FTranslate.class:1536 +#: FTranslate.class:1537 msgid "Find a string in translation" msgstr "Encontrar una cadena en la traducción" -#: FTranslate.class:1592 +#: FTranslate.class:1593 msgid "&New..." msgstr "&Nuevo..." -#: FTranslate.class:1598 +#: FTranslate.class:1599 msgid "Reload translation" msgstr "Recargar traducción" -#: FTranslate.class:1599 +#: FTranslate.class:1600 msgid "&Reload" msgstr "&Recargar" -#: FTranslate.class:1605 +#: FTranslate.class:1606 msgid "Delete translation" msgstr "Borrar traducción" -#: FTranslate.class:1612 +#: FTranslate.class:1613 msgid "Import a translation file" msgstr "Importar un archivo de traducción" -#: FTranslate.class:1613 +#: FTranslate.class:1614 msgid "&Import..." msgstr "&Importar..." -#: FTranslate.class:1619 +#: FTranslate.class:1620 msgid "Export to a translation file" msgstr "Exportar a un archivo de traducciones" -#: FTranslate.class:1620 +#: FTranslate.class:1621 msgid "&Export..." msgstr "&Exportar..." -#: FTranslate.class:1631 +#: FTranslate.class:1632 msgid "&Close" msgstr "&Cerrar" @@ -3723,30 +3728,33 @@ msgstr "Crear paquete fuente" msgid "Source packages" msgstr "Paquetes fuente" -#: Project.module:3551 +#: Project.module:3552 msgid "Cannot copy file &1." msgstr "No es posible copiar el archivo &1." -#: Project.module:3563 +#: Project.module:3564 msgid "Linking a directory is forbidden." msgstr "Enlazar un directorio no está permitido." -#: Project.module:3593 +#: Project.module:3594 msgid "Cannot create link &1." msgstr "No es posible crear el enlace &1." -#: Project.module:3605 +#: Project.module:3606 msgid "Cannot move a directory inside itself." msgstr "No es posible mover un directorio dentro de sí mismo." -#: Project.module:3649 +#: Project.module:3650 msgid "Cannot move file &1." msgstr "No es posible mover el archivo &1." -#: Project.module:4184 +#: Project.module:4185 msgid "modified" msgstr "modificado" #: Save.module:38 msgid "Cannot save file !" msgstr "¡No es posible guardar el archivo!" + +#~ msgid "Stack size" +#~ msgstr "Tamaño de la pila" diff --git a/gb.gtk/src/CWidget.cpp b/gb.gtk/src/CWidget.cpp index f55a8e242..2573dca3b 100644 --- a/gb.gtk/src/CWidget.cpp +++ b/gb.gtk/src/CWidget.cpp @@ -28,6 +28,9 @@ #define __CWIDGET_CPP +#include "widgets.h" +#include "gdesktop.h" + #include "CWidget.h" #include "CWindow.h" #include "CMenu.h" @@ -63,8 +66,11 @@ DECLARE_EVENT(EVENT_Unplugged); DECLARE_EVENT(EVENT_PlugError); //static void *CLASS_Image = NULL; -static void *CLASS_UserContainer = NULL; -static void *CLASS_UserControl = NULL; +static void *CLASS_UserContainer = 0; +static void *CLASS_UserControl = 0; + +static CWIDGET *_old_active_control = 0; +static bool _focus_change = false; /** Action *****************************************************************/ @@ -136,7 +142,7 @@ void gb_plug_raise_error(gControl *sender) // GB.Unref(POINTER(&_object)); // } -bool gb_raise_MouseEvent(gControl *sender,long type) +bool gb_raise_MouseEvent(gControl *sender, int type) { void *ob = GetObject(sender); @@ -186,7 +192,7 @@ bool gb_raise_MouseEvent(gControl *sender,long type) return false; } -bool gb_raise_KeyEvent(gControl *sender,long type) +bool gb_raise_KeyEvent(gControl *sender, int type) { CWIDGET *_ob=GetObject(sender); @@ -203,7 +209,7 @@ bool gb_raise_KeyEvent(gControl *sender,long type) return false; } -void gb_raise_EnterLeave(gControl *sender,long type) +void gb_raise_EnterLeave(gControl *sender, int type) { CWIDGET *_ob=GetObject(sender); @@ -218,22 +224,36 @@ void gb_raise_EnterLeave(gControl *sender,long type) } } -void gb_raise_FocusEvent(gControl *sender,long type) +static void post_focus_change(void *) { - CWIDGET *_ob=GetObject(sender); + CWIDGET *active = GetObject(gDesktop::activeControl()); - if (!_ob) return; - switch(type) + if (active != _old_active_control) { - case gEvent_FocusIn: - GB.Raise((void*)_ob,EVENT_GotFocus,0); - break; - case gEvent_FocusOut: - GB.Raise((void*)_ob,EVENT_LostFocus,0); - break; + if (_old_active_control) + GB.Raise(_old_active_control, EVENT_LostFocus, 0); + + _old_active_control = active; + + if (active) + GB.Raise(active, EVENT_GotFocus, 0); } + _focus_change = FALSE; } +void gb_raise_FocusEvent(gControl *sender, int type) +{ + CWIDGET *control = GetObject(sender); + + if (!control) + return; + + if (_focus_change) + return; + + _focus_change = TRUE; + GB.Post((void (*)())post_focus_change, NULL); +} bool gb_raise_Drag(gControl *sender) { @@ -263,21 +283,21 @@ void DeleteControl(gControl *control) { CWIDGET *widget = (CWIDGET*)control->hFree; - if (widget) - { - GB.StoreVariant(NULL, (void *)&widget->tag); - CACTION_register(widget, NULL); - } + if (!widget) + return; + + if (_old_active_control == widget) + _old_active_control = NULL; + + GB.StoreVariant(NULL, (void *)&widget->tag); + CACTION_register(widget, NULL); WINDOW_kill((CWINDOW*)widget); - if (widget) - { - GB.Unref(POINTER(&widget->font)); - widget->font = NULL; - widget->widget = NULL; - GB.Unref(POINTER(&widget)); - } + GB.Unref(POINTER(&widget->font)); + widget->font = NULL; + widget->widget = NULL; + GB.Unref(POINTER(&widget)); } diff --git a/gb.gtk/src/gcontrol.cpp b/gb.gtk/src/gcontrol.cpp index ad26259f1..cd6b94e23 100644 --- a/gb.gtk/src/gcontrol.cpp +++ b/gb.gtk/src/gcontrol.cpp @@ -686,18 +686,14 @@ void gControl::setMouse(int m) if (m == -2) { - if (!curs) - { - mous = -1; - updateCursor(NULL); - } - if (!curs->cur) + if (!curs || !curs->cur) { mous = -1; updateCursor(NULL); } + else + updateCursor(curs->cur); - updateCursor(curs->cur); return; } @@ -1344,7 +1340,7 @@ void gControl::setBackground(gColor color) if (!bg_set) { - if (pr) + if (pr && !use_base) color = pr->realBackground(); } diff --git a/gb.gtk/src/gcontrol.h b/gb.gtk/src/gcontrol.h index b53c7e085..7aeec9b0a 100644 --- a/gb.gtk/src/gcontrol.h +++ b/gb.gtk/src/gcontrol.h @@ -128,10 +128,10 @@ public: // "Signals" void (*onFinish)(gControl *sender); // Special - void (*onFocusEvent)(gControl *sender,long type); - bool (*onKeyEvent)(gControl *sender,long type); - bool (*onMouseEvent)(gControl *sender,long type); - void (*onEnterLeave)(gControl *sender,long type); + void (*onFocusEvent)(gControl *sender, int type); + bool (*onKeyEvent)(gControl *sender, int type); + bool (*onMouseEvent)(gControl *sender, int type); + void (*onEnterLeave)(gControl *sender, int type); bool (*onDrag)(gControl *sender); bool (*onDragMove)(gControl *sender); void (*onDrop)(gControl *sender); diff --git a/gb.gtk/src/gdesktop.cpp b/gb.gtk/src/gdesktop.cpp index 0aeb3af70..d168c927e 100644 --- a/gb.gtk/src/gdesktop.cpp +++ b/gb.gtk/src/gdesktop.cpp @@ -65,8 +65,6 @@ gCursor::gCursor(gPicture *pic,int px,int py) buf=pic->getPixbuf(); cur=gdk_cursor_new_from_pixbuf(dp,buf,x,y); - g_object_unref(buf); - } gCursor::gCursor(gCursor *cursor) diff --git a/gb.gtk/src/gmainwindow.cpp b/gb.gtk/src/gmainwindow.cpp index 4470d070b..04b54b932 100644 --- a/gb.gtk/src/gmainwindow.cpp +++ b/gb.gtk/src/gmainwindow.cpp @@ -957,6 +957,8 @@ void gMainWindow::reparent(gContainer *newpr, int x, int y) setForeground(fg); setFont(font()); + gMenu::checkMenuBar(this); + move(x, y); gtk_widget_set_size_request(border, width(), height()); } diff --git a/gb.gtk/src/gmenu.cpp b/gb.gtk/src/gmenu.cpp index 9795b4ae9..28fcc4d5b 100644 --- a/gb.gtk/src/gmenu.cpp +++ b/gb.gtk/src/gmenu.cpp @@ -358,6 +358,35 @@ void gMenu::initialize() menus=g_list_append (menus,(gpointer)this); } +void gMenu::checkMenuBar(gMainWindow *win) +{ + bool vl; + int i; + gMenu *menu; + + if (win->menuBar) + { + vl = false; + for (i = 0;; i++) + { + menu = gMenu::winChildMenu(win, i); + if (!menu) + break; + if (menu->isVisible()) + { + vl = true; + break; + } + } + + if (vl) + gtk_widget_show(GTK_WIDGET(win->menuBar)); + else + gtk_widget_hide(GTK_WIDGET(win->menuBar)); + //fprintf(stderr, "checkMenuBar: %s %d\n", win->name(), GTK_WIDGET_VISIBLE(GTK_WIDGET(win->menuBar))); + } +} + void gMenu::embedMenuBar(gMainWindow *par, GtkWidget *border) { GtkVBox *box; @@ -377,12 +406,11 @@ void gMenu::embedMenuBar(gMainWindow *par, GtkWidget *border) gtk_widget_reparent(par->widget, GTK_WIDGET(box)); gtk_container_add(GTK_CONTAINER(border),GTK_WIDGET(box)); - //gtk_container_add(GTK_CONTAINER(box),par->widget); gtk_widget_show_all(GTK_WIDGET(box)); - //g_object_unref(par->widget); - gtk_widget_show_all(GTK_WIDGET(par->menuBar)); + //gtk_widget_show(GTK_WIDGET(par->menuBar)); set_gdk_fg_color(GTK_WIDGET(par->menuBar),par->foreground()); set_gdk_bg_color(GTK_WIDGET(par->menuBar),par->background()); + checkMenuBar(par); } } @@ -420,8 +448,6 @@ gMenu::gMenu(gMenu *par, bool hidden) accel = par->accel; g_object_ref(accel); - //_style = SEPARATOR; - //update(); setText(NULL); setVisible(!hidden); } @@ -516,8 +542,6 @@ bool gMenu::isVisible() void gMenu::updateVisible() { - GtkContainer *par; - GList *chd,*iter; bool vl = _visible; if (top_level && _style != MENU) @@ -526,24 +550,7 @@ void gMenu::updateVisible() g_object_set(G_OBJECT(menu),"visible",vl,(void *)NULL); if (top_level && pr) - { - vl = false; - par = GTK_CONTAINER(((gMainWindow*)pr)->menuBar); - chd = gtk_container_get_children(par); - iter = g_list_first(chd); - while (iter) - { - if (GTK_WIDGET_VISIBLE(GTK_WIDGET(iter->data))) - { - vl = true; - break; - } - iter = g_list_next(iter); - } - - g_list_free(chd); - g_object_set(G_OBJECT(par), "visible", vl, (void *)NULL); - } + checkMenuBar((gMainWindow *)pr); } void gMenu::setVisible(bool vl) diff --git a/gb.gtk/src/gmenu.h b/gb.gtk/src/gmenu.h index 9da494409..06caf44c4 100644 --- a/gb.gtk/src/gmenu.h +++ b/gb.gtk/src/gmenu.h @@ -74,7 +74,8 @@ public: void hideSeparators(); static void embedMenuBar(gMainWindow *win, GtkWidget *border); - + static void checkMenuBar(gMainWindow *win); + private: gMenuStyle _style, _oldstyle; diff --git a/gb.gtk/src/gsignals.cpp b/gb.gtk/src/gsignals.cpp index a630a8623..6bde69e61 100644 --- a/gb.gtk/src/gsignals.cpp +++ b/gb.gtk/src/gsignals.cpp @@ -277,10 +277,11 @@ gboolean gcb_focus_out(GtkWidget *widget,GdkEventFocus *event,gControl *data) if (!gApplication::allEvents()) return false; + gDesktop::setActiveControl(NULL); + if (data->onFocusEvent) data->onFocusEvent(data,gEvent_FocusOut); gKey::setActiveControl(NULL); - gDesktop::setActiveControl(NULL); //gMainWindow::setActiveWindow(NULL); return false; diff --git a/gb.qt/src/CWidget.cpp b/gb.qt/src/CWidget.cpp index 19082951f..1bd760117 100644 --- a/gb.qt/src/CWidget.cpp +++ b/gb.qt/src/CWidget.cpp @@ -71,7 +71,8 @@ GB_CLASS CLASS_Printer; static QMap _x11_to_qt_keycode; #endif -/* Control class */ +static bool _focus_change = false; +static CWIDGET *_old_active_control = 0; static void set_mouse(QWidget *w, int mouse, void *cursor) @@ -1649,6 +1650,8 @@ void CWidget::destroy() if (CWIDGET_active_control == ob) CWIDGET_active_control = NULL; + if (_old_active_control == ob) + _old_active_control = NULL; set_name(ob, 0); @@ -1677,17 +1680,28 @@ static void post_dblclick_event(void *control) GB.Unref(&control); } -static void post_gotfocus_event(void *_object) +static void post_focus_change(void *) { - if (WIDGET && WIDGET->hasFocus()) - GB.Raise(THIS, EVENT_GotFocus, 0); - GB.Unref(&_object); + if (CWIDGET_active_control != _old_active_control) + { + if (_old_active_control) + GB.Raise(_old_active_control, EVENT_LostFocus, 0); + + _old_active_control = CWIDGET_active_control; + + if (CWIDGET_active_control) + GB.Raise(CWIDGET_active_control, EVENT_GotFocus, 0); + } + _focus_change = FALSE; } -static void post_lostfocus_event(void *control) +static void handle_focus_change() { - GB.Raise(control, EVENT_LostFocus, 0); - GB.Unref(&control); + if (_focus_change) + return; + + _focus_change = TRUE; + GB.Post((void (*)())post_focus_change, NULL); } @@ -1728,31 +1742,16 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event) } 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); - } - } - + //qDebug("FocusIn: %p %s (%p)", control, control->name, CWIDGET_active_control); + CWIDGET_active_control = control; + handle_focus_change(); CWINDOW_activate(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); + //qDebug("FocusOut: %p %s (%p)", control, control->name, CWIDGET_active_control); + CWIDGET_active_control = NULL; + handle_focus_change(); } else if (type == QEvent::ContextMenu) {