Skip to content

Instantly share code, notes, and snippets.

Created April 20, 2010 01:54
Show Gist options
  • Save anonymous/371917 to your computer and use it in GitHub Desktop.
Save anonymous/371917 to your computer and use it in GitHub Desktop.
// ==========================================================================
// Project: CamUi - mainPage
// Copyright: ©2010 My Company, Inc.
// ==========================================================================
/*globals CamUi */
ControlPanelView = SC.StackedView.extend({
childViews: 'axialCmdButtons axisSelectionLabel axisSelectionRadio momementModeLabel movementModeRadio feedrateLabel feedrateSlider'.w(),
useStaticLayout: YES,
axialCmdButtons: SC.SegmentedView.design(SC.StaticLayout,{
className: "controlPanelChild",
useStaticLayout: YES,
items: [
{ title: "-", value: "-1"/*, icon: static_url("icons/Minus.png")*/ },
{ title: "Stop", value: "0"/*, icon: static_url("icons/Char - Dot.png")*/ },
{ title: "+", value: "+1"/*, icon: static_url("icons/Plus.png")*/ }],
itemTitleKey: 'title',
itemValueKey: 'value',
itemIconKey: 'icon',
value: "0".w()
}),
axisSelectionLabel: SC.LabelView.design(SC.StaticLayout,{
className: "controlPanelChild",
useStaticLayout: YES,
tagName: "b",
value: "Axis"
}),
axisSelectionRadio: SC.RadioView.design(SC.StaticLayout,{
className: "controlPanelChild",
useStaticLayout: YES,
items: [
{ title: "X", value: 1, enabled: YES },
{ title: "Y", value: 2, enabled: YES },
{ title: "Z", value: 3, enabled: YES },
{ title: "E", value: 4, enabled: YES }
],
title: "Axis",
value: '1',
itemTitleKey: 'title',
itemValueKey: 'value',
layoutDirection: SC.LAYOUT_HORIZONTAL
}),
momementModeLabel: SC.LabelView.design(SC.StaticLayout,{
className: "controlPanelChild",
useStaticLayout: YES,
tagName: "b",
value: "Mode"
}),
movementModeRadio: SC.RadioView.design(SC.StaticLayout,{
className: "controlPanelChild",
useStaticLayout: YES,
items: [
{ title: "Continuous", value: 1, enabled: YES },
{ title: "Increment", value: 2, enabled: YES },
],
title: "Movement Mode",
value: 'Continuous',
itemTitleKey: 'title',
itemValueKey: 'value',
layoutDirection: SC.LAYOUT_VERTICAL
}),
feedrateLabel: SC.LabelView.design(SC.StaticLayout,{
className: "controlPanelChild",
useStaticLayout: YES,
tagName: "b",
value: "Feedrate"
}),
feedrateSlider: SC.SliderView.design(SC.StaticLayout, {
useStaticLayout: YES,
maximum: 1000,
minimum: 0,
value: 10
})
});
// This page describes the main user interface for your application.
CamUi.mainPage = SC.Page.design({
// The main pane is made visible on screen as soon as your app is loaded.
// Add childViews to this pane for views to display immediately on page
// load.
mainPane: SC.MainPane.design({
childViews: 'controlPanelView'.w(),
controlPanelView: ControlPanelView.design({
}),
topView: SC.ToolbarView.design({
layout: { top: 0, left: 0, right: 0, height: 36 },
childViews: 'configButton pageLabel'.w(),
anchorLocation: SC.ANCHOR_TOP
}),
pageLabel: SC.LabelView.design({
layout: { centerY: 0, height: 24, left: 8 },
controlSize: SC.LARGE_CONTROL_SIZE,
fontWeight: SC.BOLD_WEIGHT,
value: 'CNC Control Panel'
}),
configButton: SC.ButtonView.design({
layout: { centerY: 0, height: 24, right: 12, width: 100 },
title: "Configure"
})
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment