English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 31 December 2023, 23:04   #1
Warty
Registered User
 
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
Menus open "too high" on menu bar?

Anybody know what I'm doing wrong here? I am working on a game, with a target of 1.3-3.2. The menus are drawing up about 3 pixels too high on 3.2.1 and 3.1. On 1.3 and 2.0, they start where I would expect them to. (same code). Easier to look at the screenshots than parse these words.

Huh: I am getting errors when trying to attach screenshots. weird.
Warty is offline  
Old 31 December 2023, 23:08   #2
Warty
Registered User
 
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
hmm. "database error". Well, here's a cross-link to another forum where I posted a couple screenshots that show "good" and "bad" menus. Hope the internet godz don't blast me for this.
https://www.amigalove.com/viewtopic....659e0ba38c6d61
Warty is offline  
Old 01 January 2024, 11:12   #3
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,000
Show the code...
thomas is offline  
Old 01 January 2024, 15:17   #4
Warty
Registered User
 
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
Code:
/*****************************************************************************/
/*                               Definitions                                 */
/*****************************************************************************/

// FULLMENUNUM is defined in intuition.h, but not in the KS1.3 NDK. 
#define FULLMENUNUM_COPY( menu, item, sub )	\
	( SHIFTSUB(sub) | SHIFTITEM(item) | SHIFTMENU(menu) )

#define MENU_TEXT_INSET	5	// how many pixels from left edge of menu that text start
									// CHECKWIDTH can be used to provide space for a checkmark
#define MENU_FORE_PEN	15	// we change the color palette, and not all combos are readable
#define MENU_BACK_PEN	0
		
		
/*****************************************************************************/
/*                           File-scope Variables                            */
/*****************************************************************************/

// set up the intuiTexts for all menus and menu items





/************  GAME menu **************/

static struct IntuiText menuItemLabelGameNewGame = 
{
	MENU_FORE_PEN,			// FrontPen
	MENU_BACK_PEN,			// BackPen, only used if not JAM1
	JAM1,					// DrawMode. Note: JAM2 will draw background around chars only, not entire row
	MENU_TEXT_INSET,		// LeftEdge, use common inset value I define
							// No need to leave space for checkmark in this app's menu system
	1,						// TopEdge, 1 line down.
	NULL,					// TextAttr, default font.
	NULL,					// IText, the string: leave null when initializing, assign during localization pass
	NULL					// NextItem, no link to other IntuiText structures.
};

static struct IntuiText menuItemLabelGameRestoreToLast = 
{
	MENU_FORE_PEN,			// FrontPen
	MENU_BACK_PEN,			// BackPen, only used if not JAM1
	JAM1,					// DrawMode. Note: JAM2 will draw background around chars only, not entire row
	MENU_TEXT_INSET,		// LeftEdge, use common inset value I define
							// No need to leave space for checkmark in this app's menu system
	1,						// TopEdge, 1 line down.
	NULL,					// TextAttr, default font.
	NULL,					// IText, the string: leave null when initializing, assign during localization pass
	NULL					// NextItem, no link to other IntuiText structures.
};

static struct IntuiText menuItemLabelGameAbandonGame = 
{
	MENU_FORE_PEN,			// FrontPen
	MENU_BACK_PEN,			// BackPen, only used if not JAM1
	JAM1,					// DrawMode. Note: JAM2 will draw background around chars only, not entire row
	MENU_TEXT_INSET,		// LeftEdge, use common inset value I define
							// No need to leave space for checkmark in this app's menu system
	1,						// TopEdge, 1 line down.
	NULL,					// TextAttr, default font.
	NULL,					// IText, the string: leave null when initializing, assign during localization pass
	NULL					// NextItem, no link to other IntuiText structures.
};

// The MenuItem structure for the 3rd item:
static struct MenuItem menuItemGameAbandonGame=
{
	NULL,								// NextItem, linked to the 4th item.
	0,									// LeftEdge, 0 pixels out.
	20,									// TopEdge, 3rd item = 20 lines down
	250,								// Width = leave some space for l10n expansion
	10,									// Height, 10 lines high.
	ITEMTEXT|							// Flags, render this item with text.
	ITEMENABLED|						//        this item will be enabled.
	HIGHCOMP,							//        complement the colours when highlighted.
	0x00000000,							// MutualExclude: no exclusion
	(APTR)&menuItemLabelGameAbandonGame,	// ItemFill, pointer to the text.
	NULL,								// SelectFill, nothing since we complement the col.
	0,									// Command, no command-key sequence.
	NULL,								// SubItem, no subitem list.
	MENUNULL,							// NextSelect, no items selected.
};

// The MenuItem structure for the 2nd item:
static struct MenuItem menuItemGameRestoreToLast=
{
	&menuItemGameAbandonGame,			// NextItem, linked to the 4th item.
	0,									// LeftEdge, 0 pixels out.
	10,									// TopEdge, 2nd item = 10 lines down
	250,								// Width = leave some space for l10n expansion
	10,									// Height, 10 lines high.
	COMMSEQ|
	ITEMTEXT|							// Flags, render this item with text.
	ITEMENABLED|						//        this item will be enabled.
	HIGHCOMP,							//        complement the colours when highlighted.
	0x00000000,							// MutualExclude: no exclusion
	(APTR)&menuItemLabelGameRestoreToLast,	// ItemFill, pointer to the text.
	NULL,								// SelectFill, nothing since we complement the col.
	82,									// Command = R
	NULL,								// SubItem, no subitem list.
	MENUNULL,							// NextSelect, no items selected.
};

// The MenuItem structure for the 1st item:
static struct MenuItem menuItemGameNewGame=
{
	&menuItemGameRestoreToLast,			// NextItem, linked to the 4th item.
	0,									// LeftEdge, 0 pixels out.
	0,									// TopEdge, first item = 0 lines down
	250,								// Width = leave some space for l10n expansion
	10,									// Height, 10 lines high.
	COMMSEQ|
	ITEMTEXT|							// Flags, render this item with text.
	ITEMENABLED|						//        this item will be enabled.
	HIGHCOMP,							//        complement the colours when highlighted.
	0x00000000,							// MutualExclude: no exclusion
	(APTR)&menuItemLabelGameNewGame,	// ItemFill, pointer to the text.
	NULL,								// SelectFill, nothing since we complement the col.
	78,									// Command = N
	NULL,								// SubItem, no subitem list.
	MENUNULL,							// NextSelect, no items selected.
};






/************  APP menu items **************/

static struct IntuiText menuItemLabelAppQuit = 
{
	MENU_FORE_PEN,			// FrontPen
	MENU_BACK_PEN,			// BackPen, only used if not JAM1
	JAM1,					// DrawMode. Note: JAM2 will draw background around chars only, not entire row
	MENU_TEXT_INSET,		// LeftEdge, use common inset value I define
							// No need to leave space for checkmark in this app's menu system
	1,						// TopEdge, 1 line down.
	NULL,					// TextAttr, default font.
	NULL,					// IText, the string: leave null when initializing, assign during localization pass
	NULL,					// NextItem, no link to other IntuiText structures.
};

static struct IntuiText menuItemLabelAppAbout = 
{
	MENU_FORE_PEN,			// FrontPen
	MENU_BACK_PEN,			// BackPen, only used if not JAM1
	JAM1,					// DrawMode. Note: JAM2 will draw background around chars only, not entire row
	MENU_TEXT_INSET,		// LeftEdge, use common inset value I define
							// No need to leave space for checkmark in this app's menu system
	1,						// TopEdge, 1 line down.
	NULL,					// TextAttr, default font.
	NULL,					// IText, the string: leave null when initializing, assign during localization pass
	NULL					// NextItem, no link to other IntuiText structures.
};

static struct IntuiText menuItemLabelAppHelp = 
{
	MENU_FORE_PEN,			// FrontPen
	MENU_BACK_PEN,			// BackPen, only used if not JAM1
	JAM1,					// DrawMode. Note: JAM2 will draw background around chars only, not entire row
	MENU_TEXT_INSET,		// LeftEdge, use common inset value I define
							// No need to leave space for checkmark in this app's menu system
	1,						// TopEdge, 1 line down.
	NULL,					// TextAttr, default font.
	NULL,					// IText, the string: leave null when initializing, assign during localization pass
	NULL					// NextItem, no link to other IntuiText structures.
};

// The MenuItem structure for the 3rd item:
static struct MenuItem menuItemAppQuit=
{
	NULL,							// NextItem: none
	0,								// LeftEdge, 0 pixels out.
	20,								// TopEdge, 3rd item = 20 lines down
	140,							// Width = leave some space for l10n expansion
	10,								// Height, 10 lines high.
	COMMSEQ|
	ITEMTEXT|						// Flags, render this item with text.
	ITEMENABLED|					//        this item will be enabled.
	HIGHCOMP,						//        complement the colours when highlighted.
	0x00000000,						// MutualExclude: no exclusion
	(APTR)&menuItemLabelAppQuit,	// ItemFill, pointer to the text.
	NULL,							// SelectFill, nothing since we complement the col.
	81,								// Command = Q
	NULL,							// SubItem, no subitem list.
	MENUNULL,						// NextSelect, no items selected.
};

// The MenuItem structure for the 2nd item:
static struct MenuItem menuItemAppAbout=
{
	&menuItemAppQuit,				// NextItem, linked to the 3rd item.
	0,								// LeftEdge, 0 pixels out.
	10,								// TopEdge, 2nd item = 10 lines down
	140,							// Width = leave some space for l10n expansion
	10,								// Height, 10 lines high.
	ITEMTEXT|						// Flags, render this item with text.
	ITEMENABLED|					//        this item will be enabled.
	HIGHCOMP,						//        complement the colours when highlighted.
	0x00000000,						// MutualExclude: no exclusion
	(APTR)&menuItemLabelAppAbout,	// ItemFill, pointer to the text.
	NULL,							// SelectFill, nothing since we complement the col.
	0,								// Command, no command-key sequence.
	NULL,							// SubItem, no subitem list.
	MENUNULL,						// NextSelect, no items selected.
};

// The MenuItem structure for the 1st item:
static struct MenuItem menuItemAppHelp=
{
	&menuItemAppAbout,				// NextItem, linked to the 2nd item.
	0,								// LeftEdge, 0 pixels out.
	00,								// TopEdge, first item = 0 lines down
	140,							// Width = leave some space for l10n expansion
	10,								// Height, 10 lines high.
	ITEMTEXT|						// Flags, render this item with text.
	ITEMENABLED|					//        this item will be enabled.
	HIGHCOMP,						//        complement the colours when highlighted.
	0x00000000,						// MutualExclude: no exclusion
	(APTR)&menuItemLabelAppHelp,	// ItemFill, pointer to the text.
	NULL,							// SelectFill, nothing since we complement the col.
	0,								// Command, no command-key sequence.
	NULL,							// SubItem, no subitem list.
	MENUNULL,						// NextSelect, no items selected.
};



/*****************************************************************************/
/*                             Global Variables                              */
/*****************************************************************************/



// top-level menus (need to be accessed by other files)
struct Menu menuActions=
{
	NULL,							// NextMenu, no more menu structures.
	78+38+10+10,					// LeftEdge = total of each (previous menu width + 10 px spacer)
	0,								// TopEdge, for the moment ignored by Intuition.
	62,								// Width = font char width * num chars + 6 px padding
	0,								// Height, for the moment ignored by Intuition.
	MENUENABLED,					// Flags
	NULL,							// MenuName: leave null when initializing, assign during localization pass
	&menuItemActionsCycleMagic		// FirstItem, pointer to the first menu item in the list.
};

struct Menu menuGame=
{
	&menuActions,					// NextMenu
	78+10,							// LeftEdge = total of each (previous menu width + 10 px spacer)
	0,								// TopEdge, for the moment ignored by Intuition.
	38,								// Width = font char width * num chars + 6 px padding
	0,								// Height, for the moment ignored by Intuition.
	MENUENABLED,					// Flags
	NULL,							// MenuName: leave null when initializing, assign during localization pass
	&menuItemGameNewGame			// FirstItem, pointer to the first menu item in the list.
};

struct Menu menuApp=
{
	&menuGame,						// NextMenu
	0,								// LeftEdge, left corner.
	0,								// TopEdge, for the moment ignored by Intuition.
	78,								// Width = font char width * num chars + 6 px padding
	0,								// Height, for the moment ignored by Intuition.
	MENUENABLED,					// Flags
	NULL,							// MenuName: leave null when initializing, assign during localization pass
	&menuItemAppHelp				// FirstItem, pointer to the first menu item in the list.
};
Warty is offline  
Old 01 January 2024, 15:57   #5
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,000
Works for me.
Attached Thumbnails
Click image for larger version

Name:	055.png
Views:	77
Size:	4.3 KB
ID:	81242  
thomas is offline  
Old 01 January 2024, 16:27   #6
Warty
Registered User
 
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
What version of OS is that?

Maybe it's something with how I have my Workbench setup. I think I have a clean (unmodified) 3.2.1. install setup around somewhere, I'll test on that too. It's only a couple rows of pixels that get covered up, so not a huge deal, but...
Warty is offline  
Old 02 January 2024, 11:38   #7
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,000
Quote:
Originally Posted by Warty View Post
What version of OS is that?
It is 3.1. You said 1.3 was ok, 3.1 was not. I was curious to see it myself, but it did not happen to me.


Quote:
Maybe it's something with how I have my Workbench setup.
I guess VisualPrefs can cause things like this.
thomas 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
Menus in 1.3, CHECKIT "Checkmark" not clearing.. desiv Coders. C/C++ 2 09 April 2023 04:02
Can I get the "slide bar" back in Newshell with OS3.2? pushead support.AmigaOS 4 20 August 2021 14:48
Bringeing back the orange "E - F" bar in Workbench Overmann support.Other 4 24 February 2019 19:59
A600 "flashing" title bar in WB emuola support.Hardware 2 12 May 2017 19:13
Auto-position the "Select a floppy disk image file..." menu Maren request.UAE Wishlist 17 30 January 2010 15:44

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 13:25.

Top

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