Count of MenuItems

Discussions about document viewing.
Post Reply
helloworld
Posts: 2
Joined: Wed May 30, 2012 2:01 pm

Count of MenuItems

Post by helloworld » Wed May 30, 2012 3:02 pm

Hi,

I remove some MenuItems with RemoveItemMenu(). Now I would like to do it in a loop and exclude those elements, what I need.

My question is, how can I get a count of all Menuitems? At the moment they are 39.

Thanks

Alex

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Count of MenuItems

Post by Loïc » Thu May 31, 2012 10:54 pm

Hello helloworld,
how can I get a count of all Menuitems?
Well, just decrement a counter in your loop, each time you remove an item!

Let me know if I misunderstood your problem, I have a doubt...

Kind regards,

Loïc

helloworld
Posts: 2
Joined: Wed May 30, 2012 2:01 pm

Re: Count of MenuItems

Post by helloworld » Fri Jun 01, 2012 9:07 am

Hi Loic,

sorry for my bad explaination and english, i try it another way :-)

this is the List of all MenuItems at the moment:
  • 1: Pages / Frames
    2: Pages / Frames -> Goto First
    3: Pages / Frames -> Goto Previous
    4: Pages / Frames -> Goto Next
    5: Pages / Frames -> Goto Last
    6: Play Gif
    7: Stop Gif Animation
    8: Rotations - Flips
    9: Rotations - Flips -> Rotate ( see page 901) 90°
    10: Rotations - Flips -> Rotate ( see page 901) 180°
    11: Rotations - Flips -> Rotate ( see page 901) 270°
    12: Rotations - Flips -> Flip X
    13: Rotations - Flips -> RotateFlip 90°
    14: Rotations - Flips -> RotateFlip 180°
    15: Rotations - Flips -> RotateFlip 270°
    16: ScrollBars ( see page 971)
    17: Copy to Clipboard ( see page 209)
    18: Zoom ( see page 972)
    19: Zoom ( see page 972) -> Zoom ( see page 972) in
    20: Zoom ( see page 972) -> Zoom ( see page 972) out
    21: Zoom ( see page 972) -> Zoom ( see page 972) 100%
    22: Zoom ( see page 972) -> Zoom ( see page 972) to selected area
    23: Zoom ( see page 972) -> Fit image to viewer (keepaspect ratio)
    24: Zoom ( see page 972) -> Fit image to viewer (don'tkeep aspect ratio)
    25: Zoom ( see page 972) -> Fit image to viewer width
    26: Zoom ( see page 972) -> Fit image to viewer height
    27: Mouse Mode
    28: Mouse Mode -> Nothing
    29: Mouse Mode -> Hand Pan Tool
    30: Mouse Mode -> Area Selection Tool
    31: Mouse Mode -> Area Zooming ( see page 964) Tool
    32: Viewer Quality
    33: Viewer Quality -> Automatic
    34: Viewer Quality -> Quality Low
    35: Viewer Quality -> Quality Bilinear
    36: Viewer Quality -> Quality Bicubic
    37: Viewer Quality -> Quality Bilinear HQ
    38: Viewer Quality -> Quality Bicubic HQ
    39: Mouse Mode -> Magnifier Tool
In my MFC-application i want to show only MenuItems with Index 1-5, 8-11 and 18-20. Another Items sholdn't be visible.
Here a example, how I do it:

Code: Select all


for(int i = 6; i < 8; i++)
	m_pGdViewer->RemoveItemMenu(i);

for(int i = 12; i < 18; i++)
	m_pGdViewer->RemoveItemMenu(i);

for(int i = 21; i <= iCount; i++)
	m_pGdViewer->RemoveItemMenu(i);

How can I fill the variable "iCount"? I'm looking for something like this: iCount = m_pGdViewer->ItemMenuCount;
The Value of iCount would be at the moment "39". But It can increase with future verions of GdPicture.NET.

If i set the Value "39" manualy, and another software installs/overwrites a newer Version of Gdpicture.NET,
who contanis new MenuItems (index > 39), they would be visible in my application but not implemented.

Kind regards,

Alex

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Count of MenuItems

Post by Loïc » Fri Jun 01, 2012 1:27 pm

Hello,

OK I see. You can define iCount = 32768

This is not super sexy but this will work for future releases.

Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 1 guest