-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For Menu.wmTimer use Menu.indexOf instead of MenuItem.index #1575
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ | |
public class MenuItem extends Item { | ||
Menu parent, menu; | ||
long hBitmap; | ||
int id, accelerator, userId, index; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The index field was introduce when support for tooltips were added. I've eliminate the use/need for it, hence removed it. |
||
int id, accelerator, userId; | ||
ToolTip itemToolTip; | ||
/* Image margin. */ | ||
final static int MARGIN_WIDTH = 1; | ||
|
@@ -94,7 +94,7 @@ public class MenuItem extends Item { | |
public MenuItem (Menu parent, int style) { | ||
super (parent, checkStyle (style)); | ||
this.parent = parent; | ||
parent.createItem (this, (index = parent.getItemCount ())); | ||
parent.createItem (this, parent.getItemCount ()); | ||
} | ||
|
||
/** | ||
|
@@ -136,16 +136,7 @@ public MenuItem (Menu parent, int style) { | |
public MenuItem (Menu parent, int style, int index) { | ||
super (parent, checkStyle (style)); | ||
this.parent = parent; | ||
parent.createItem (this, (this.index = index)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks confusingly like a removall, but note there is addition below:
|
||
} | ||
|
||
MenuItem (Menu parent, Menu menu, int style, int index) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I remove the unused parameter I noticed that the entire constructor is unused so it seems better to remove it. |
||
super (parent, checkStyle (style)); | ||
this.parent = parent; | ||
this.menu = menu; | ||
this.index = index; | ||
if (menu != null) menu.cascade = this; | ||
display.addMenuItem (this); | ||
parent.createItem (this, index); | ||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fundamental change here is to compute the correct index using the existing method for computing the index.