Harpo 18-03-2024, 21:28
Saludos,

Me ha surgido un problema con el control ComboBox estándar.
Por un lado uso dos monitores, configurados para extender las pantallas, el principal y a la izquierda el secundario.

El control ComboBox usa un Form interno para mostrar los datos, y antes de mostrarlo calcula las coordenadas en pantalla. Para este cálculo utiliza la clase Screens, la cual es un array con las pantallas que hay en el sistema. Selecciona la pantalla en la cual se encuentra el control y utiliza sus propiedades para obtener la posición del Form interno del control.

La última linea de cálculo de coordenadas es esta:
Código:
If X < hScreen.AvailableX Then X = hScreen.AvailableX

El caso es que al tener dos pantallas, la principal (Screen0) y la secundaria (Screen1), en modo extendido a la izquierda, si el formulario que contiene el ComboBox está en la principal, no funciona. He escrito un pequeño programa para ver qué propiedades tienen las pantallas y este es el resultado:
[Imagen: lXQ9Erh.png]
Como se ve la propiedad AvailableX de Screen0 es 1600. Eso hace que el formulario del ComboBox no se muestre o se muestre fuera de sitio.
Uso GTK3 y lo más curioso de todo es que he probado QT5, los valores que salen son idénticos, pero si muestra bien el formulario interno del ComboBox.

Si alguien trabaja también con dos pantallas y le interesa, subo el programa y probamos.
Un saludo, Harpo.
Shell 17-03-2024, 10:24
Buenos días, feliz domingo!.

Gambas se ha actualizado a la 3.19.1

Novedades en Gambas 3.19.1
 
Cita: 
The main features of this release are the following:

    Huge interpreter optimizations, making it faster than Python, Perl and Java interpreters in all benchmarks!

    Support for the russian e2k architecture.

    Many enhancements to the IDE image editor.

    The IDE can generate AppImage packages.

    The IDE project tree filter is a lot faster.

    Add global shortcut to LinkedIn, following KDE merge request #1731.

    Support for computed GOTO and GOSUB.

    New Dec and Base$ functions for converting integers in any base.

    The database component now can retrieve the contents of a newly inserted record, provided that the database driver supports it.

    The gb.desktop component now uses the freedesktop portal by default if present.

    A new default icon theme named gambas-thin.

    Better Wayland support in GUI components.

    A new syntax highlighter component based on definition files: gb.highlight.

    Add wayland support to the gb.media and gb.media.form components, and fix many problems.

    Add support for the dict:// protocol in the gb.net.curl component.

Saludos

(17-03-2024, 10:24)Shell escribió: Huge interpreter optimizations, making it faster than Python, Perl and Java interpreters in all benchmarks!

Ejem...ejem..
alberto-moyano 17-03-2024, 01:51
Hola gente, tengo la siguiente función (que es una adaptación de un aporte de Tincho), la cuestión es que no obtengo error alguno, pero tampoco hace lo que espero.

En concreto, se supone que lee un directorio a través de un path (revisado que existe en otra función) y listar los archivos que encuentra en un menú existente en el formulario.

Código:
Public Sub ShowFilesMenu()

  Dim strPath As String

  strPath = rutaScriptsExternos
  ShowFilesMenuWithPath(strPath)

End

Public Sub ShowFilesMenuWithPath(strPath As String)

  ShowFilesMenuInternal(strPath)

End

Public Sub ShowFilesMenuInternal(strPath As String, Optional stxExt As String[], Optional bolRec As Boolean)

  Dim stxFiles As New String[]
  Dim strFile As String
  Dim i As Integer

  stxFiles = RListFiles(strPath, stxExt, bolRec)

  Dim oMenu As New FMain.Menu77 'indico el menú donde se mostrara el listado de archivos

  For Each strFile In stxFiles
    Dim oMenuItem As Menu77
    oMenuItem = oMenu.Add(MenuFileFromPath(strFile))
    oMenuItem.Tag = strFile
    Connection(oMenuItem, "Activate", Me, "OpenFile")
  Next

End

Public Sub OpenFile(sender As Object)

  Dim strFilePath As String

  strFilePath = Sender.Tag

End

Private Function MenuFileFromPath(strFilePath As String) As String
  ' Esta función toma un camino completo de un archivo
  ' y devuelve solo el nombre del archivo para mostrar en el menú.

  Dim strFile As String

  strFile = File.Name(strFilePath)
  Return strFile

End

Public Function RListFiles(strPath As String, Optional stxExt As String[], Optional bolRec As Boolean) As String[]

  Dim stxTmp As New String[]
  Dim stxFiles As New String[]
  Dim strFile As String
  Dim strExt As String

  stxTmp.Clear
  stxFiles.Clear

  strPath = ArrangePath(strPath)

  Select Stat(strPath).Type
    Case gb.File
      strPath = File.Dir(strPath)
  End Select

  If stxExt <> Null Then
    Select stxExt.Count
      Case 0
        If bolRec = True Then
          stxTmp.Insert(RDir(strPath, "*.py"))
        Else
          stxTmp.Insert(Dir(strPath, "*.py", gb.File))
        Endif

      Case Else
        For Each strExt In stxExt
          If bolRec = True Then
            stxTmp.Insert(RDir(strPath, "*." & strExt))
          Else
            stxTmp.Insert(Dir(strPath, "*." & strExt, gb.File))
          Endif
        Next

    End Select
  Else

    If bolRec = True Then
      stxTmp.Insert(RDir(strPath, "*.py"))
    Else
      stxTmp.Insert(Dir(strPath, "*.py", gb.File))
    Endif
  Endif

  For Each strFile In stxTmp
    Select Stat(strPath &/ strFile).Type
      Case gb.File
        stxFiles.Add(strPath &/ strFile)
    End Select
  Next

  Return stxFiles

End

Public Function ArrangePath(strPath As String) As String

  If Right(strPath, 1) <> "/" Then
    strPath &= "/"
  Endif
  Return strPath

End

Alguna idea de por donde vienen los tiros
Páginas (564):    1 98 99 100 101 102 564   
Bienvenido, Invitado
Tienes que registrarte para poder participar en nuestro foro.
Recordarme?
Miembros: 292
Último miembro: DarkWolf
Temas del foro: 1,742
Mensajes del foro: 9,030
Últimos temas
Ordenar en un TableView
Foro: General
Último mensaje por: guizans, Hace 11 horas
Respuestas: 4 - Vistas: 124
Odio a gb.Report
Foro: General
Último mensaje por: guizans, 02-11-2025, 13:36
Respuestas: 9 - Vistas: 1,570
Reportes de Gambas
Foro: Aplicaciones/Fragmentos de Código
Último mensaje por: Alberto59, 27-10-2025, 16:34
Respuestas: 2 - Vistas: 1,335
Ordenando las carpetas
Foro: Programación en otros lenguajes
Último mensaje por: tercoide, 22-10-2025, 15:57
Respuestas: 0 - Vistas: 116
Powered By MyBB, © 2002-2025 MyBB Group.
Made with by Curves UI.