Atualização Hwgui 23-08-2026

Projeto HwGui - Biblioteca visual para Harbour/xHarbour

Moderador: Moderadores

Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 8281
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 7 vezes
Curtiram: 2 vezes

Atualização Hwgui 23-08-2026

Mensagem por Itamar M. Lins Jr. »

Olá!

Código: Selecionar todos

2026-08-23 17:01 UTC+0200  Itamar Lins  <itamarlins at gmail.com>
   * source/winapi/dialog.c
     - s_DlgProc(), s_PSPProc(): fixed WM_DESTROY handler unconditionally
       decrementing iDialogs/shifting aDialogs[] even when the closing
       hWnd was not found in the array, silently corrupting the modeless
       dialog/property-sheet-page tracking array; the array is now only
       touched when the handle is actually located.
     - s_DlgProc(), s_PSPProc(): the PHB_ITEM duplicate created by
       SetWindowObject() at WM_INITDIALOG was never released, leaking
       one Harbour item per created/destroyed dialog; it is now released
       via hb_itemRelease() right after the WM_DESTROY event has been
       dispatched to the .prg ONEVENT handler.
     - HWG_DLGBOXINDIRECT(): validate hWndParent with IsWindow() before
       passing it to DialogBoxIndirectParam(); falls back to the main
       window handle (aWindows[0]) when the received parent no longer
       refers to an existing window, instead of silently failing to
       create the dialog (DialogBoxIndirectParam returning 0/-1 with
       ERROR_INVALID_WINDOW_HANDLE / no error code at all). Logs the
       failure (GetLastError) via hwg_writelog() when creation still
       fails after the fallback.
     - s_CreateDlgTemplate(), new s_FixupLargeCaptions(): the Windows
       DLGTEMPLATE is a native 16-bit (WORD-addressed) structure; a
       control caption larger than HWG_MAX_INLINE_CAPTION (2000 wide
       chars) could overflow/corrupt the template buffer and make
       DialogBoxIndirectParam()/CreateDialogIndirectParam() silently
       fail to create the window. Such captions are now left empty in
       the template and applied afterwards via WM_SETTEXT, once the
       dialog and its child controls already exist (called from
       WM_INITDIALOG in both s_ModalDlgProc() and s_DlgProc()).
       Fixes report/preview dialogs failing to open when the embedded
       text (e.g. a large EDITBOX report) exceeds the template's
       structural limit.
   * source/winapi/hdialog.prg
     - METHOD FindDialog(): was only searching ::aDialogs (modeless
       dialogs), never ::aModalDialogs, making it unable to resolve a
       dialog passed explicitly to hwg_EndDialog(handle) whenever it
       wasn't also the current Atail(aModalDialogs); now searches both
       arrays.
     - METHOD Activate(): after Hwg_DlgBoxIndirect(), if ::handle is
       still empty (dialog window failed to be created), the object is
       now removed from its tracking array (::DelItem()) immediately
       instead of being left as an orphaned entry at the top of
       aModalDialogs/aDialogs - which previously caused a later,
       unrelated Close()/hwg_EndDialog() call to receive an empty
       handle and fail with a parameter error.

2026-08-20 02:58 UTC-0200 Itamar Lins <itamarlins at gmail.com>
   Win64 Portability & Memory Alignment Fixes
   * source/winapi/dialog.c:
     - Fixed critical 32-bit pointer truncation in s_lpwAlign() by replacing
       legacy ULONG/ULONGLONG compiler-conditional guards with ULONG_PTR,
       preventing C0000005 ACCESS_VIOLATION crashes under Win64 Clang environments.
     - Upgraded dialog callback procedure signatures (s_ModalDlgProc, s_DlgProc,
       s_PSPProc, s_PSPProcRelease) from LRESULT to INT_PTR to maintain stack
       frame integrity on 64-bit systems.
     - Fixed variable truncation for Harbour engine event handling by migrating
       from 'long int' / hb_parnl() to LONG_PTR / hb_parnll().
     - Refactored dynamic template handling in HWG_DLGBOXINDIRECT to utilize
       explicit 64-bit casting and direct instance binding via GetModuleHandle(NULL).
   * source/winapi/animat.c, draw.c, freeimg.c, misc.c, nice.c, resource.c, richedit.c, shellapi.c, window.c, wprint.c:
     - Fixed widespread -Wint-to-pointer-cast and -Wpointer-to-int-cast warnings.
     - Migrated API pointer/handle extractions from hb_parnl() to hb_parptr() or
       HB_PARHANDLE() macros.
     - Updated Windows API data mappings (e.g., EDITSTREAM.dwCookie mapped to
       DWORD_PTR instead of DWORD).
     - Fixed return macros by substituting invalid HB_RETHANDLE() usages on
       pure logical indicators (e.g., ReleaseDC, DeleteEnhMetaFile) with hb_retl().

2026-08-17 21:58 UTC-0200 Itamar Lins <itamarlins at gmail.com>
    * source/gtk/window.c: Updated HB_FUNC( HWG_ACTIVATEDIALOG ) to
      receive and process the parent window handle parameter. Fixed
      native GTK2 window modal and transient stacking layout chain by
      applying gtk_window_set_modal() and gtk_window_set_transient_for().
      Deferred the application input lock (gtk_grab_add) to the high-priority
      idle cycle callback (gtk_shared_force_center_on_idle) to secure full
      GtkMenuBar / background menus lockout right AFTER the asynchronous
      Browse geometry allocation (introduced in r3852) completes its
      lifecycle layout mapping. Ensured proper input recovery by calling
      gtk_grab_remove() immediately upon nested gtk_main() termination.

2026-08-16 16:58 UTC-0200 Itamar Lins <itamarlins at gmail.com>
   * source/gtk/window.c:
     (HWG_ACTIVATEDIALOG): Injected a high-priority idle callback via g_idle_add_full
     to force exact screen centering when the modal loop initiates, overriding
     asynchronous layout shifts caused by packed controls.
   * source/gtk/control.c:
     (HWG_CREATEBROWSE): Removed gtk_main_iteration loop to prevent premature
     event flushes from breaking dialog window alignment.
     (HWG_SETADJOPTIONS): Re-enabled native adjustment changed notification signals.
   * source/gtk/hbrowse.prg:
     Fixed duplicate DATA declarations and mapped properties to proper uppercase.
     Adjusted signal return values (retValue = 0) in hbrowse event loop to allow
     proper GtkScrollbar allocation and render tracks correctly.
   * source/gtk/hdialog.prg:
     (InitModalDlg): Changed return statement from 1 to 0 to prevent the underlying
     C engine from overriding position layout bounds after Center() execution.
     (onPAINT): Removed infinite invalidation loop inside background canvas.
Saudações,
Itamar M. Lins Jr.
alxsts
Colaborador
Colaborador
Mensagens: 3196
Registrado em: 12 Ago 2008 15:50
Localização: São Paulo-SP-Brasil
Curtiram: 9 vezes

Re: Atualização Hwgui 23-08-2026

Mensagem por alxsts »

Olá!

Muito bom! Parabéns Itamar!
[]´s
Alexandre Santos (AlxSts)
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 8281
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 7 vezes
Curtiram: 2 vezes

Re: Atualização Hwgui 23-08-2026

Mensagem por Itamar M. Lins Jr. »

Olá!
Registrando.
Esse bug "principal" era que não abria um arquivo texto com muitas linhas. Exatamente por conta desse LIMITE de 16Bits!
Só que PROCURANDO, a IA vai resolvendo outras coisas... Muitas nem são tão problemáticas assim e tem coisa que ela faz e faz TUDO ERRADO!
Tipo, achar que IsObject() do C é o mesmo no Harbour, ai coloca no fonte corrigido. No Harbour é hb_IsObject() e outros problemas devido as minhas LIMITAÇÕES técnicas.

PS. Alias nem sei se menos de 2 mil linhas é tão grande assim.
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 8281
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 7 vezes
Curtiram: 2 vezes

Re: Atualização Hwgui 23-08-2026

Mensagem por Itamar M. Lins Jr. »

Olá!
Explicação da IA para leigos, que nem EU :lol:
Se não me engano esse problema está na Hwgui desde sempre.
Tem uma gambiarra, rich edit...Não lembro direito.
2026-08-25_11-00-33.png
2026-08-25_11-00-33.png (164.97 KiB) Exibido 251 vezes
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
sygecom
Administrador
Administrador
Mensagens: 7156
Registrado em: 21 Jul 2006 10:12
Localização: Alvorada-RS
Curtiram: 1 vez
Contato:

Re: Atualização Hwgui 23-08-2026

Mensagem por sygecom »

Chic no ultimo
Leonardo Machado
xHarbour.org + Hwgui + PostgreSql
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20582
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP
Curtiram: 3 vezes

Re: Atualização Hwgui 23-08-2026

Mensagem por JoséQuintas »

Lembrei daquele bug maluco com seu fonte.
Tá bom de testar de novo com essas alterações.
José M. C. Quintas
Harbour 3.2, mingw, multithread, gtwvg, fivewin 25.12, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui), (hmg3), (hmg extended), (oohg), PNotepad, ASP, (Linux/Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Responder