English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 02 April 2023, 23:31   #1
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Don't Receive WMHI_CHANGEWINDOW

Hi there!

I'm yet again stumped

I create this ClassAct window and listen to some of its properties: while I can receive WMHI_CLOSEWINDOW or WMHI_VANILLAKEY, I never receive WMHI_CHANGEWINDOW or WMHI_MOUSEMOVE.

I looked at many examples, including on Thomas' and Peter's Web sites, no luck... I must be missing something obvious in the definition of my window or when listening to the events?

Here are some essential (?) parts of my code:

Code:
	win_object = NewObject(
		WINDOW_GetClass(),  NULL,
		WA_ScreenTitle,     version_get_version(),
		WA_Title,           "AmiModRadio",
		WA_Left,            prefs_get_main_window_X(),
		WA_Top,             prefs_get_main_window_Y(),
		WA_DepthGadget,     TRUE,
		WA_DragBar,         TRUE,
		WA_CloseGadget,     TRUE,
		WA_Activate,        TRUE,
		WA_SmartRefresh,    TRUE,
		WA_IDCMP,           IDCMP_CHANGEWINDOW | IDCMP_MOUSEMOVE | IDCMP_VANILLAKEY,
		WINDOW_ParentGroup, lay_object,
		TAG_END);

...

	GetAttr(
		WINDOW_SigMask,
		_object->window_object,
		&window_signals);

...

		signals = Wait(SIGBREAKF_CTRL_C |
					   ...
					   window_signals);

...

		if((signals & window_signals) == window_signals)
		{
			while((signalsResult = CA_HandleInput(_object->window_object, NULL)) != WMHI_LASTMSG)
			{
				switch(signalsResult & WMHI_CLASSMASK)
				{
				case WMHI_CLOSEWINDOW:
					is_closing = TRUE;
					break;

				case WMHI_VANILLAKEY:
					printf("WMHI_VANILLAKEY\n");
					break;

				case WMHI_MOUSEMOVE:
					printf("WMHI_MOUSEMOVE\n");
					break;

				case WMHI_CHANGEWINDOW:
					printf("WMHI_CHANGEWINDOW\n");
					_prefs_save_position();
					break;

...
Thanks in advance!

Last edited by tygre; 02 April 2023 at 23:38.
tygre is offline  
Old 03 April 2023, 14:12   #2
bebbo
bye
 
Join Date: Jun 2016
Location: Some / Where
Posts: 680
Quote:
Originally Posted by tygre View Post
Hi there!

I'm yet again stumped

I create this ClassAct window and listen to some of its properties: while I can receive WMHI_CLOSEWINDOW or WMHI_VANILLAKEY, I never receive WMHI_CHANGEWINDOW or WMHI_MOUSEMOVE.

I looked at many examples, including on Thomas' and Peter's Web sites, no luck... I must be missing something obvious in the definition of my window or when listening to the events?

Here are some essential (?) parts of my code:

Code:
    win_object = NewObject(
        WINDOW_GetClass(),  NULL,
        WA_ScreenTitle,     version_get_version(),
        WA_Title,           "AmiModRadio",
        WA_Left,            prefs_get_main_window_X(),
        WA_Top,             prefs_get_main_window_Y(),
        WA_DepthGadget,     TRUE,
        WA_DragBar,         TRUE,
        WA_CloseGadget,     TRUE,
        WA_Activate,        TRUE,
        WA_SmartRefresh,    TRUE,
        WA_IDCMP,           IDCMP_CHANGEWINDOW | IDCMP_MOUSEMOVE | IDCMP_VANILLAKEY,
        WINDOW_ParentGroup, lay_object,
        TAG_END);

...

    GetAttr(
        WINDOW_SigMask,
        _object->window_object,
        &window_signals);

...

        signals = Wait(SIGBREAKF_CTRL_C |
                       ...
                       window_signals);

...

        if((signals & window_signals) == window_signals)
        {
            while((signalsResult = CA_HandleInput(_object->window_object, NULL)) != WMHI_LASTMSG)
            {
                switch(signalsResult & WMHI_CLASSMASK)
                {
                case WMHI_CLOSEWINDOW:
                    is_closing = TRUE;
                    break;

                case WMHI_VANILLAKEY:
                    printf("WMHI_VANILLAKEY\n");
                    break;

                case WMHI_MOUSEMOVE:
                    printf("WMHI_MOUSEMOVE\n");
                    break;

                case WMHI_CHANGEWINDOW:
                    printf("WMHI_CHANGEWINDOW\n");
                    _prefs_save_position();
                    break;

...
Thanks in advance!

maybe you have to add the wanted events here:
Code:
WA_IDCMP,           IDCMP_CHANGEWINDOW | IDCMP_MOUSEMOVE | IDCMP_VANILLAKEY | WMHI_CHANGEWINDOW | WMHI_WHAT_EVA | ...,
bebbo is offline  
Old 03 April 2023, 22:23   #3
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Hi Bebbo!

Thanks for your help! I tried your suggestion but I still don't receive these events

Besides, I thought that WA_IDCMP only takes IDCMP flags and that ClassAct "magically" translates these, like for VANILLAKEY: I specify IDCMP_VANILLAKEY but receive WMHI_VANILLAKEY.

What really confuses me is that the couple IDCMP_VANILLAKEY/WMHI_VANILLAKEY works but not the couple IDCMP_CHANGEWINDOW/WMHI_CHANGEWINDOW

Cheers!
tygre is offline  
Old 04 April 2023, 11:11   #4
Minuous
Coder/webmaster/gamer
 
Minuous's Avatar
 
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,629
The code in your fragment looks OK. It looks like you are using an ancient ClassAct version? It could be a bug in window.class that has since been fixed (certainly there were plenty of those!), so I would suggest upgrading to OS3.2 which has a much better implementation of window.class.

The suggestion to add WMHI_#? flags to WA_IDCMP is wrong; Intuition is not going to know what to do with them.
Minuous is offline  
Old 05 April 2023, 05:00   #5
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Hi Minuous!

Thanks for your help! You put the finger exactly where my problem was: I was using ClassAct v2 instead of the latest v3.3.

Since I installed v3.3, WA_IDCMP, IDCMP_CHANGEWINDOW produces WMHI_CHANGEWINDOW as expected!

Cheers!
tygre is offline  
Old 05 April 2023, 15:25   #6
Minuous
Coder/webmaster/gamer
 
Minuous's Avatar
 
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,629
Glad it helped. ClassAct 3.3 is 25 years old though so it is the "latest" version only in the sense that soon afterwards the name was changed to ReAction and development continued under that name.
Minuous is offline  
Old 06 April 2023, 04:13   #7
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Hi Minuous!

I know! In our Amiga parallel universe, time works differently

I heard and read about ReAction but I'm confused about where/how to get it: AmigaSystem was telling me that it's in OS v3.9 and I think that it's also in v3.2... but can I get if for v3.1 independently? And what about its SDK?

Cheers!
tygre is offline  
Old 06 April 2023, 09:16   #8
Minuous
Coder/webmaster/gamer
 
Minuous's Avatar
 
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,629
ReAction is not available separately, it has been integrated into AmigaOS. Older versions of it are in OS3.5 and OS3.9, the latest version is in OS3.2(.2).

The SDK for ReAction is part of the Amiga NDK, which is freely available, eg. from https://www.hyperion-entertainment.c...=form&file=126
Minuous is offline  
Old 06 April 2023, 09:26   #9
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
ClassAct is available for free, the SDK is shareware.

ReAction is only available for users paying for new OS versions. The SDK is free.

It's a good strategy to develop on 3.1 with ClassAct. Programs will continue to work with ReAction, but you also reach users running 3.1.
thomas is offline  
Old 06 April 2023, 17:04   #10
tygre
Returning fan!
 
tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,434
Hi Minuous and Thomas!

Thanks for your answers

I bought v3.2 but I want AmiModRadio to work on 3.1 so I'll stick to ClassAct for now... Maybe I'll add a ReAction UI later to benefit from new classes!

Cheers!
tygre is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
How does WinUAE receive dragged archives? Foebane support.WinUAE 22 03 May 2021 20:40
AmiFTP/AmFTP cant receive FTP file list Leandro Jardim support.Apps 9 24 January 2018 23:10
anybody receive this security alert from ZoneAlarm? jharrison support.WinUAE 10 25 February 2008 18:19
transdisk error after receive from pc Schattenmeister support.Hardware 1 09 October 2003 22:18

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:21.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.18470 seconds with 13 queries