English Amiga Board


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

 
 
Thread Tools
Old 09 April 2023, 01:53   #1
desiv
Registered User
 
desiv's Avatar
 
Join Date: Oct 2009
Location: Salem, OR
Posts: 1,770
Menus in 1.3, CHECKIT "Checkmark" not clearing..

Update: Found it. I was leaving off the MENUTOGGLE flag..

I found a printout of an old solitaire game I wrote, OCRd it, did some fixes (probably lots more needed), and I am working on trying to get it to recompile again.
I only had the printout, so no other files, which included my menu structures.
I have been rebuilding those...

I am pretty close to getting them to rebuild, but I have something quirky happening, and I'm not sure if it means I am just missing something obvious (likely) or could there be something else wrong in my code that is causing this?

Basically, I have two menus. Projects (Play, New, Quit, About) and Options (Card Sounds, Extra Sounds, Cycle Deck, 1 At A Time).
The options menu are all CHECKIT items. And currently CHECKED by default.

When starting, the menu appears to work. The items are there, with their default checkmarks. And the (bad) program logic works, in that if I use the mouse to deselect it, the card sound stops or it goes from 1 card at a time to 3, etc...

But the menu still has the checkmark on it after I have unselected it.
I know I have successfully unselected it, because the program is resulting as such. If I reselect it, the program works as expected (card sounds on, etc), and the checkmark is still there.

The checkmark is never not there...
If I try it without the CHECKED option it starts with no checkmark. Good.
I can select it and it gets it's checkmark. Good.
And the program recognizes the change. Good
If I unselect it, the program recognizes the change, BUT, the checkmark is still there...

Anything obvious I should be checking?

Thanx!
Note, I am using DICE 3.16 with the 1.3 includes.
Also note, I can't say for sure if the main program code (that I have OCRd) did that before. It's a printout of a point in time of my code. And I know my game worked properly back in the day. But I can't say for sure that this version of my main program worked. I don't remember this issue, but it was 32 years ago, so I wouldn't.

Last edited by desiv; 09 April 2023 at 04:01.
desiv is offline  
Old 09 April 2023, 03:33   #2
desiv
Registered User
 
desiv's Avatar
 
Join Date: Oct 2009
Location: Salem, OR
Posts: 1,770
FYI, here is what I have for my menus.h...
Still poking at it.. ;-)

Code:
struct IntuiText text1 =
{ 0, 1, JAM2, 0, 1, NULL, "About", NULL };
struct IntuiText text2 =
{ 0, 1, JAM2, 0, 1, NULL, "Quit", NULL };
struct IntuiText text3 =
{ 0, 1, JAM2, 0, 1, NULL, "New", NULL };
struct IntuiText text4 =
{ 0, 1, JAM2, 0, 1, NULL, "Play", NULL };

struct MenuItem item1 =
{ NULL,   0, 36, 100, 12, ITEMTEXT|ITEMENABLED|HIGHCOMP,         0, (APTR) &text1, NULL, NULL, NULL, 0 };
struct MenuItem item2 =
{ &item1, 0, 24, 100, 12, ITEMTEXT|ITEMENABLED|COMMSEQ|HIGHCOMP, 0, (APTR) &text2, NULL, 'Q', NULL, 0 };
struct MenuItem item3 =
{ &item2, 0, 12, 100, 12, ITEMTEXT|ITEMENABLED|COMMSEQ|HIGHCOMP, 0, (APTR) &text3, NULL, 'N', NULL, 0 };
struct MenuItem item4 =
{ &item3, 0, 0,  100, 12, ITEMTEXT|ITEMENABLED|COMMSEQ|HIGHCOMP, 0, (APTR) &text4, NULL, 'P', NULL, 0 };

struct IntuiText text11 =
{ 0, 1, JAM2, CHECKWIDTH, 1, NULL, "1 At A Time", NULL };
struct IntuiText text12 =
{ 0, 1, JAM2, CHECKWIDTH, 1, NULL, "Cycle Deck", NULL };
struct IntuiText text13 =
{ 0, 1, JAM2, CHECKWIDTH, 1, NULL, "Extra Sounds", NULL };
struct IntuiText text14 =
{ 0, 1, JAM2, CHECKWIDTH, 1, NULL, "Card Sounds", NULL };

struct MenuItem item11 =
{ NULL,    0, 36, 150, 12, ITEMTEXT|ITEMENABLED|CHECKIT|CHECKED|COMMSEQ|HIGHCOMP, 0, (APTR) &text11, NULL, 'D', NULL, 0 };
struct MenuItem item12 =
{ &item11, 0, 24, 150, 12, ITEMTEXT|ITEMENABLED|CHECKIT|CHECKED|COMMSEQ|HIGHCOMP, 0, (APTR) &text12, NULL, 'C', NULL, 0 };
struct MenuItem item13 =
{ &item12, 0, 12, 150, 12, ITEMTEXT|ITEMENABLED|CHECKIT|CHECKED|COMMSEQ|HIGHCOMP, 0, (APTR) &text13, NULL, 'E', NULL, 0 };
struct MenuItem item14 =
{ &item13, 0,  0, 150, 12, ITEMTEXT|ITEMENABLED|CHECKIT|CHECKED|COMMSEQ|HIGHCOMP, 0, (APTR) &text14, NULL, 'S', NULL, 0 };



struct Menu menu2 =
{ NULL, 80, 0, 60, 0, MENUENABLED, "Options", &item14, 0, 0, 0, 0 };

struct Menu my_menu =
{ &menu2, 0, 0, 60, 0, MENUENABLED, "Project", &item4, 0, 0, 0, 0 };
desiv is offline  
Old 09 April 2023, 04:02   #3
desiv
Registered User
 
desiv's Avatar
 
Join Date: Oct 2009
Location: Salem, OR
Posts: 1,770
Found it...
I had the CHECKIT, but not the MENUTOGGLE...
Added that, and it is working as expected... (Not the whole program, just the menus, but it is progress!!)
Code:
{ &item13, 0,  0, 150, 12, ITEMTEXT|ITEMENABLED|CHECKIT|CHECKED|MENUTOGGLE|COMMSEQ|HIGHCOMP, 0, (APTR) &text14, NULL, 'S', NULL, 0 };
desiv 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
"Diabolik" & "Dylan Dog" & "Tex" & "Time Runners" series DamienD request.Old Rare Games 20 21 July 2022 16:58
"Voices8" 8 Channel Soundtracker "DemoSongI" song - "This is the Amiga with 8 Voices" DemosongIHunter request.Music 45 23 May 2022 20:07
"Screech!! v2.41" & "Screech!! [AGA] v2.51" - "HD install" --> "ADFs" DamienD request.Old Rare Games 45 15 June 2020 12:42
"Reminder "Lincs Amiga User Group aka "LAG" Meet Sat 5th of January 2013" rockape News 4 30 January 2013 00:06
CD32 Image-Name-Bug: "...(bla)[!].zip" -> "...(bla)[" / "...[test].zip" -> "...[tes" cfTrio support.WinUAE 8 18 December 2012 16:31

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 22:17.

Top

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