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
?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
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;.
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."
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.
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.
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.
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.