zertovitch / gwindows Goto Github PK
View Code? Open in Web Editor NEWGWindows: GUI framework for MS Windows
Home Page: https://sf.net/projects/gnavi/
GWindows: GUI framework for MS Windows
Home Page: https://sf.net/projects/gnavi/
I need WM_ERASEBKGND
and WM_PAINT
callbacks for a custom Status_Bar_Type
.
These callbacks are declared for GWindows.Window.Window_Type
but not for GWindows.Base.Base_Window_Type
.
StatusBar_Type
is derived from GWindows.Base.Base_Window_Type
.
What is the best way to add WM_ERASEBKGND
and WM_PAINT
management to my Status Bar ?
Status_Bar
in GWindows.Common_Controls
? That might lead to compatibility problems.WM_ERASEBKGND
and WM_PAINT
management to GWindows.Base.Base_Window_Type
?WM_ERASEBKGND
and WM_PAINT
management to my custom control using On_Message
?The hack allowing to get the directory path from an Explorer window at an arbitrary (X, Y) location doesn't work anymore.
You can notice by running the sample (project: gwindows_samples.gpr) cap_test.adb.
Some keywords to explore a solution:
SHDocVw
ShellWindowsClass
path
NB: Ada generated code exists for SHDocVw, see tutorials\msie\ie.ads
Additionally the recommended method seen on Stack Overflow is to enumerate objects in the SHDocVw.ShellWindows collection; for each ie in that collection, match those with ie.FullName = "explorer" (after some treatement); grab the path via ie.LocationURL.
With GNAT versions after CE 2021, GWindows.Common.Dialogs' procedure Get_Directory raises Program_Error at line 1042 (call to SHGetPathFromIDList).
This issue seems to be similar to issue 26.
Someone has noticed an issue ( https://sourceforge.net/p/l-e-a/tickets/1/ ) that is actually affecting GWindows, for multi-document windows.
You can see it happening on the sample : ./gwindows/samples/mdi/mdi_example.adb , which can be built through the project file gwindows_samples.gpr .
When built for 64-bit, the application adds to the Window menu new entries corresponding to news MDI child windows, as expected; the behaviour is identical to 32-bit build.
But a click on the menu entries themselves are doing nothing in the 64-bit version. Notably, the method On_MDI_Activate is not called.
Similarly, when there are more than 9 child windows, the "More windows..." (text in Windows user's language) is in the menu, but nothing happens when this menu entry is selected.
The issue seems to be tricky, since the system manages this part automatically - at least theoretically...
In the MS doc, you can read:
https://docs.microsoft.com/en-us/windows/win32/winmsg/about-the-multiple-document-interface
"The system can add up to ten menu items to the window menu. When the tenth child window is created, the system adds the More Windows item to the window menu. Clicking this item displays the Select Window dialog box. The dialog box contains a list box with the titles of all MDI child windows currently available. The user can activate a child window by clicking its title in the list box."
Hi,
I'm running an up-to-date Windows 11 VM but purposely developing Windows x86 32-bit code because I need to interact with an existing 32-bit project that cannot be migrated to 64-bit. As of July 2, 2024 the current master branch requires a few small code and compiler option corrections to work with AdaCore's last released community Windows 32bit-only compiler - one error might be a bug (unconstrained array using out-only parameter needs bounds?), the rest seem correct under existing Ada rules where GNAT has gotten a lot better at detecting accessibility issues in the last 8 years or so. The vast majority are accessibility warnings. However I'm pretty sure you know what you're doing so the code I'm recommending just either gets around the problem or suppresses the problem messages to allow compilation to continue by using unchecked_access instead of access. The very last one, that's likely a bug can only be gotten around by removing the "warnings are errors, -gnatwe" option in the GNATCOM.GPR file.
Patch file included.
GNAVI.patch_mingw32_GCC6_3_1_ADACORE_2017.patch
gnatocx-irunningobjecttable_interface.adb:135:39: non-local pointer cannot point to local object gnatocx-imoniker_interface.adb:327:60: non-local pointer cannot point to local object gnatcom-create-iconnectionpointcontainer.adb:87:07: warning: foreign caller must pass bounds explicitly
There are a few more files with the same non-local pointer error but I don't have them saved. The patch file addresses them by simply changing the access attribute.
I'm running this on an up-to-date Windows 11 VM but with Adacore's gnat-gpl-2017-x86-windows-bin.exe community edition compiler (GCC 6.3.1), thought I suspect these non-local pointer errors would occur with any modern GCC compiler today.
The only reason I'm using this compiler is I was normally an MSYS2 user which has all the recent stuff (Alire uses it too). However the MSYS2 people have done a lot of damage removing the 32 bit library support as of about two years ago (search "32-bit" on https://www.msys2.org/news/). Even though the modern 64-bit GCC/GNAT compilers can in fact produce 32-bit object code (-m32), MSYS2 LD can't seem to link it, no 32-bit libs! I fought for week on this before I just gave up and hunted down a 32-bit only, all in one, Adacore environment because I'm only dealing with 32-bit exclusively for an older project and that must stay in 32-bit and this was the easiest way to get going.
Thanks for the great library and doc file! I look forward to really trying this out!
Built with GNAT version after GNAT CE 2021:
.\gwindows\test\test_clipboard.exe
raised CONSTRAINT_ERROR : gwindows-clipboard.adb:386 access check failed
[C:\Ada\gnavi\gwindows\test\test_clipboard.exe]
0x7ff7679437ac Adainit at gwindows-clipboard.adb:386
0x7ff767921ba9 Test_Clipboard at test_clipboard.adb:34
The issue is the name used with the pragma Import on sync_fetch_and_add in gnatcom-initialize.adb, using a recent version of GNAT Pro. See:
https://sourceforge.net/p/gnavi/bugs/14/
Unfortunately the suggested fix (replacing __sync_fetch_and_add_4 by __sync_fetch_and_add_N) breaks compatibility with previous versions of GNAT (as recent as GNAT CE 21).
I get (trying with both 'N' and 'n'):
gnatcom-initialize.adb:85:1: undefined reference to __sync_fetch_and_add_N
gnatcom-initialize.adb:85:1: undefined reference to __sync_fetch_and_add_n
Perhaps it is better to try disabling the warning.
There's a bug in file gwindows-scintilla.adb at line 2981.
NM.modificationType is of type Int_32. It is casted to Interfaces.Unsigned_32 which will raise an exception with negative numbers.
Replacing the cast with Ada.Unchecked_Conversion solves the problem.
But maybe it would be best to modify STRUCT_SCNotification definition by replacing modificationType : Int_32; with modificationType : Interfaces.Unsigned_32;.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.