comp.lang.ada
 help / color / mirror / Atom feed
From: Andre <avsaway@hotmail.com>
Subject: Re: GWindows
Date: Fri, 10 Nov 2006 19:34:36 +0100
Date: 2006-11-10T19:34:36+01:00	[thread overview]
Message-ID: <7aacd$4554c638$541eed9f$22617@home.nl> (raw)
In-Reply-To: <31e1l2t4v3kt5h3fhsto8ujju8peob63i9@4ax.com>


Yes, we are still using it in a few applications.

But you are right, besides Stephen I don't see much activity on GWindows 
repository. The last sign of life from David over 6 months ago.

Now on your actual question (yes sometimes a trigger works):

To get the BN_SETFOCUS or BN_KILLFOCUS, the button needs to have the 
BS_NOTIFY style. I added a On_Pre_Create handler to set this style.

I added the changed code:

with GWindows,
      GWindows.Base,
      GWindows.Windows,
      GWindows.Windows.Main,
      GWindows.Buttons,
      GWindows.Edit_Boxes;

use  GWindows,
      GWindows.Base,
      GWindows.Windows,
      GWindows.Windows.Main,
      GWindows.Buttons,
      GWindows.Edit_Boxes;


with Interfaces.C;

with GWindows.Application;

procedure TestKB is
   pragma Linker_Options ("-mwindows");

   Main_Window : Main_Window_Type;

   Exit_Button : Button_Type;

   TestButton : Button_Type;

   Edit_Box : Edit_Box_Type;

   --  Event handlers ---------

   --  Exit_Button_Click
   procedure Exit_Button_Click (
     Window : in out GWindows.Base.Base_Window_Type'Class
   )
   is
     pragma Warnings (Off, Window);

   begin
     GWindows.Application.End_Application;
   end Exit_Button_Click;


   --  TestButton_Focus
   procedure TestButton_Focus (
     Window : in out GWindows.Base.Base_Window_Type'Class
   )
   is
     pragma Warnings (Off, Window);

   begin
     Text (Edit_Box, "Focus");

   end TestButton_Focus;


   --  TestButton_Lost_Focus
   procedure TestButton_Lost_Focus (
     Window : in out GWindows.Base.Base_Window_Type'Class
   )
   is
     pragma Warnings (Off, Window);

   begin
     Text (Edit_Box, "Lost focus");

   end TestButton_Lost_Focus;

    procedure TestButton_Pre_Create
      (Window    : in out GWindows.Base.Base_Window_Type'Class;
       dwStyle   : in out Interfaces.C.unsigned;
       dwExStyle : in out Interfaces.C.unsigned)
    is
       pragma Warnings (Off, Window);
       pragma Warnings (Off, dwExStyle);
       use type Interfaces.C.unsigned;

       BS_NOTIFY : constant := 16#4000#;
    begin
       dwStyle := dwStyle or BS_NOTIFY;
    end TestButton_Pre_Create;


begin
   Create (
     Main_Window,
     "Test Button",
     Width => 400,
     Height => 300
   );

   Keyboard_Support (Main_Window, True);

   Create (
     Exit_Button,
     Main_Window,
     Text   => "E&xit",
     Left   => 300,
     Top    => 225,
     Width  => 75,
     Height => 34
   );

   On_Click_Handler (Exit_Button, Exit_Button_Click'Unrestricted_Access);

   On_Pre_Create_Handler (TestButton,
    TestButton_Pre_Create'Unrestricted_Access);
   Create (
     TestButton,
     Main_Window,
     Text   => "&Test",
     Left   => 30,
     Top    => 30,
     Width  => 125,
     Height => 25
   );

   On_Focus_Handler (TestButton, TestButton_Focus'Unrestricted_Access);
   On_Lost_Focus_Handler (TestButton,
    TestButton_Lost_Focus'Unrestricted_Access);

   Create (
     Edit_Box,
     Main_Window,
     Text   => "",
     Left   => 30,
     Top    => 70,
     Width  => 125,
     Height => 25
   );


   Visible (Main_Window, True);
   Focus (TestButton);

   GWindows.Application.Message_Loop;
end TestKB;

Andr�

Fionn Mac Cumhaill wrote:
> Is anybody besides me using GWindows to  create Windows applications?
> My last requests for assistance from the members of the GWindows
> mailing list produced no responses



  parent reply	other threads:[~2006-11-10 18:34 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-07 16:53 GWindows Fionn Mac Cumhaill
2006-11-07 19:31 ` GWindows Michael Bode
2006-11-08 21:23   ` GWindows Stephen
2006-11-09  7:04   ` GWindows Stephen Leake
2006-11-09 12:38     ` GWindows Jeffrey Creem
2006-11-09 18:02     ` GWindows Michael Bode
2006-11-09 22:23       ` GWindows Yves Bailly
2006-11-10 14:09         ` GWindows Alex R. Mosteo
2006-11-10 18:38           ` GWindows Yves Bailly
2006-11-10  8:56       ` GWindows Dmitry A. Kazakov
2006-11-10 21:14         ` GWindows Michael Bode
2006-11-11  9:23           ` GWindows Dmitry A. Kazakov
2006-11-11 14:50             ` GWindows Michael Bode
2006-11-10 22:40         ` GWindows Pascal Obry
2006-11-11  9:29           ` GWindows Dmitry A. Kazakov
2006-11-10 13:33       ` GWindows Stephen Leake
2006-11-08 21:22 ` GWindows Stephen
2006-11-09 14:12   ` GWindows Fionn Mac Cumhaill
2006-11-09 20:15     ` GWindows Stephen
2006-11-09 20:15     ` GWindows Stephen
2006-11-09  7:02 ` GWindows Stephen Leake
2006-11-10 18:34 ` Andre [this message]
2006-11-11  5:23   ` GWindows Fionn Mac Cumhaill
  -- strict thread matches above, loose matches on Subject: below --
2002-01-23 13:13 gwindows chris.danx
2002-01-23 21:58 ` gwindows chris.danx
2002-01-28 17:01 ` gwindows David Botton
2002-01-29  9:01   ` gwindows chris.danx
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox