Skip to content

Commit

Permalink
Code for menus and dropdowns. Also fixed checkbox ellipsis sample
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Pinzon authored and Charles Jolley committed Sep 10, 2009
1 parent 6b94c7f commit cfd2bc6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
2 changes: 2 additions & 0 deletions apps/sample_controls/controllers/pane.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ SampleControls.paneController = SC.Object.create(
{ title: "Item3", isEnabled: YES, icon: iconURL, separator: NO , branchItem: YES,
subMenu: SC.MenuPane.create({
items: ["title1","title2"],
layout: { width: 150 },
contentView: SC.View.extend({
layout: { width: 150, height: 200 }
})
Expand All @@ -189,6 +190,7 @@ SampleControls.paneController = SC.Object.create(
preferType: SC.PICKER_MENU,
subMenuKey: 'subMenu',
itemShortCutKey: 'shortCut',
layout: { width: 150 },
itemKeyEquivalentKey: 'keyEquivalent',
itemHeightKey: 'height',
contentView: SC.View.extend({
Expand Down
3 changes: 2 additions & 1 deletion apps/sample_controls/english.lproj/controls_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,8 @@ SampleControls.controlsPage = SC.Page.create({
isEnabled: NO
}, null, {
title: "Long Title Exceeds Frame",
value: YES
value: YES,
needsEllipsis: YES
}, null, {
title: "Long Title Exceeds Frame",
value: YES,
Expand Down
36 changes: 32 additions & 4 deletions apps/sample_controls/english.lproj/pane_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,38 @@ SampleControls.panePage = SC.Page.create({
title: 'SC.Menu.popup',
action: "showMenuPane",
target: "SampleControls.paneController"
}, null, {
theme: 'square',
title: 'SC.Menu.dropdown'
})


//Code for DropDownMenu
.title('Drop Down').height(24).sample(SC.DropDownMenu, {

//Type1 - selectionValue not defined by the user
title: 'SC.DropDownMenu',
objects: [ { title: "Type 1", icon: 'drop-down-icon'},
{ title: "vanilla", icon: 'drop-down-icon', pos: 1 },
{ title: "chocolate", icon: 'drop-down-icon', pos: 2 },
{ title: "straberry", icon: 'drop-down-icon', pos: 3 },
{ title: "lemon", icon: 'drop-down-icon', pos: 4 }],
nameKey: 'title',
iconKey: 'icon',
value: 'chicolate',
valueKey: 'title',
sortKey: 'pos',
checkboxEnabled: YES
}, null, {

//Type2 - selectionValue specified by user
title: 'SC.DropDownMenu',
objects: [{ title: "None", icon: 'drop-down-icon'},
{ title: "Low", icon: 'drop-down-icon' },
{ title: "Medium", icon: 'drop-down-icon' },
{ title: "High", icon: 'drop-down-icon' },
{ title: "Type 2", icon: 'drop-down-icon' }],
nameKey: 'title',
value: 'Type 2',
valueKey: 'title',
checkboxEnabled: YES
})
//End of DropDownMenu
})
});

0 comments on commit cfd2bc6

Please sign in to comment.