English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 22 November 2022, 04:52   #1
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
Intuition Menus

How do I set the background colour of the menu bar and menu items? Thanks!
Steam Ranger is offline  
Old 22 November 2022, 06:59   #2
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,215
You can't. Intuition only offers two layouts, the 2.0 layout (black background with pen 1, text with pen 0), or the new style rendering (white background, black text).
Thomas Richter is offline  
Old 22 November 2022, 23:43   #3
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
Quote:
Originally Posted by Thomas Richter View Post
You can't. Intuition only offers two layouts, the 2.0 layout (black background with pen 1, text with pen 0), or the new style rendering (white background, black text).
I want white background with black text, but the menu seems to be using the 2.0 layout.

Image 2 is my program, I want it to look like image 1.


Attached Thumbnails
Click image for larger version

Name:	workbench3-full-2211230909-01.png
Views:	438
Size:	10.4 KB
ID:	77196   Click image for larger version

Name:	workbench3-full-2211230908-01.png
Views:	439
Size:	13.3 KB
ID:	77197  
Steam Ranger is offline  
Old 23 November 2022, 00:18   #4
DisasterIncarna
Registered User
 
DisasterIncarna's Avatar
 
Join Date: Oct 2021
Location: England
Posts: 1,172
are you using the window flag WFLG_NEWLOOKMENUS ? my program had crappy looking old menus style till i enabled that flag.
DisasterIncarna is offline  
Old 23 November 2022, 00:47   #5
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
Quote:
Originally Posted by DisasterIncarna View Post
are you using the window flag WFLG_NEWLOOKMENUS ? my program had crappy looking old menus style till i enabled that flag.
What's the assembly equivelant?
Steam Ranger is offline  
Old 23 November 2022, 01:01   #6
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
For a KS3.0+ 3D look you could also try setting the pens tag (KS2.0+ but it will work in KS1.3 fine because it's ignored), at the end of ExtNewScreen (right after gadgets and custom bitmap) and ExtNewWindow (right after screen type) structures, set a pointer to tags. Something like:
Code:
MyNewScreen:
...
  DC.L 0,0  ; gadgets, custom bitmap
  DC.L MyTags  ; v36+

MyNewWindow:
...
  DC.W CUSTOMSCREEN  ; screen type
  DC.L MyTags  ; v36+

MyTags:
  DC.L SA_Pens,MyPens
  DC.L TAG_END

MyPens:
  DC.W ~0
Also, WFLG_NEWLOOKMENUS is assembly symbol ($00200000), you OR (|) it with the other flags in the ExtNewWindow structure.
a/b is offline  
Old 23 November 2022, 05:18   #7
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
Quote:
Originally Posted by a/b View Post
For a KS3.0+ 3D look you could also try setting the pens tag (KS2.0+ but it will work in KS1.3 fine because it's ignored), at the end of ExtNewScreen (right after gadgets and custom bitmap) and ExtNewWindow (right after screen type) structures, set a pointer to tags. Something like:
Code:
MyNewScreen:
...
  DC.L 0,0  ; gadgets, custom bitmap
  DC.L MyTags  ; v36+

MyNewWindow:
...
  DC.W CUSTOMSCREEN  ; screen type
  DC.L MyTags  ; v36+

MyTags:
  DC.L SA_Pens,MyPens
  DC.L TAG_END

MyPens:
  DC.W ~0
Also, WFLG_NEWLOOKMENUS is assembly symbol ($00200000), you OR (|) it with the other flags in the ExtNewWindow structure.
I'll be more specific. I have a program that runs exclusively on workbench. It's menus are grey, wheras most workbench programs have white menus.
I want my programs menus to be white aswell, how do I achieve this? (Using standard WB screen)
Steam Ranger is offline  
Old 23 November 2022, 15:51   #8
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
Which detail/block pen and flags do you specify for your window when you're creating it?

Also, forgot to mention you also have to use the NS_EXTENDED (screen) and WFLG_NW_EXTENDED (window) flag to set the tags as I described above. And ignore the whole screen part of it if you're using a public/wb screen.
a/b is offline  
Old 23 November 2022, 23:56   #9
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
I just realised changing the block pen works to change menu colour. Thanks.
Steam Ranger is offline  
Old 24 November 2022, 00:31   #10
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
I want to make it so that when a menu item is selected, it's white on black, but using the complement highlight it turns from black on white to blue on green, how do I fix this?
Steam Ranger is offline  
Old 24 November 2022, 00:43   #11
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
Also, in the menu for the clock app there are these squigly lines in the menu. How do I do that?
Steam Ranger is offline  
Old 24 November 2022, 06:16   #12
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
Quote:
Originally Posted by Steam Ranger View Post
Also, in the menu for the clock app there are these squigly lines in the menu. How do I do that?
That's a separator... Set menu item's mi_ItemFill to point to an Image struct instead of IntuiText, and set menu item's flags to HIGHNONE (meaning: gfx item, disabled, no highlight).
Image struct should be something like:
Code:
  DC.W 2,2  ; top offset, left offset
  DC.W 100,2  ; width, height
  DC.W 2  ; depth
  DC.L 0  ; image
  DC.B 0,DETAILPEN  ; plane pick, plane on/off
  DC.L 0  ; next
Or if you are using gadtools library to create menus, set label to NM_BARLABEL.
a/b is offline  
Old 24 November 2022, 22:39   #13
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
Quote:
Originally Posted by a/b View Post
That's a separator... Set menu item's mi_ItemFill to point to an Image struct instead of IntuiText, and set menu item's flags to HIGHNONE (meaning: gfx item, disabled, no highlight).
Image struct should be something like:
Code:
  DC.W 2,2  ; top offset, left offset
  DC.W 100,2  ; width, height
  DC.W 2  ; depth
  DC.L 0  ; image
  DC.B 0,DETAILPEN  ; plane pick, plane on/off
  DC.L 0  ; next
Or if you are using gadtools library to create menus, set label to NM_BARLABEL.
Thanks, I'll try that. But also how do I give the menu the "New Look"? Because I can't figure out how.
Steam Ranger is offline  
Old 24 November 2022, 23:10   #14
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
Uhm, it should work automagically?
I typically want my stuff to look like WB so I use "defaults" and have no problems... DETAILPEN and BLOCKPEN as window pens, WFLG_NEWLOOKMENUS added to flags. I get what I'm expecting visually, nothing looks mismatched compared to other apps and WB, in KS1.3/2.x/3.x (and also with MagicMenu).
Post relevant code or exe?
a/b is offline  
Old 24 November 2022, 23:52   #15
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
Oh I was being stupid.

My assembly includes are pre-v36, so the new menu define was missing and when I added it in I added $2000000 instead of $200000. Thanks for the help.
Steam Ranger is offline  
Old 25 November 2022, 01:12   #16
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
When I get a MENUPICK type message, where's the actual data?

if (number == MENUNULL) {...} else {
MenuNumber = MENUNUM(number);
ItemNumber = ITEMNUM(number);
SubNumber = SUBNUM(number);
}

How do I get number?
Steam Ranger is offline  
Old 25 November 2022, 02:04   #17
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
Use _LVOItemAddress() with a0 = menu strip and d0.w = im_Code from the message to locate the selected menu item. Or in C something like ItemAddress(menu_strip,msg->im_Code).
Number is im_Code, but you don't have to deal with that (just let the intuition do the work).
a/b is offline  
Old 26 November 2022, 12:03   #18
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
How do I make a workbench-standard file requester?

Last edited by Steam Ranger; 26 November 2022 at 13:07.
Steam Ranger is offline  
Old 26 November 2022, 20:17   #19
koobo
Registered User
 
koobo's Avatar
 
Join Date: Sep 2019
Location: Finland
Posts: 361
Quote:
Originally Posted by Steam Ranger View Post
How do I make a workbench-standard file requester?
You probably need to check out the ASL library docs: http://amigadev.elowar.com/read/ADCD.../node017B.html
koobo is offline  
Old 27 November 2022, 12:23   #20
Steam Ranger
Registered User
 
Steam Ranger's Avatar
 
Join Date: May 2022
Location: Adelaide, South Australia, Australia
Posts: 208
Unrelated, but how do I lock a file so that neither the user nor any other proccess can edit it? It can still be read by other proccesses, though.
Steam Ranger 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
Gfx glitch in menus Octopus66 support.AmigaOS 12 05 October 2021 09:54
Intuition - Menus Gilloo Coders. System 1 05 March 2012 10:11
Help ! Problems with user menus and start menus in Directory Opus 5.8 beltrixx support.Apps 0 27 May 2009 08:30
Good menus/frontends. killergorilla Retrogaming General Discussion 40 24 January 2008 21:16
Floating menus? Mojo2000 New to Emulation or Amiga scene 6 30 January 2003 14:35

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 04:27.

Top

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