Skip to content

Commit

Permalink
FilterPanel updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
og2t committed Sep 9, 2010
1 parent 4c0e12c commit b0b619c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 28 deletions.
32 changes: 9 additions & 23 deletions HiSlope.tmproj
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>currentDocument</key>
<string>src/hislope/gui/Output.as</string>
<string>src/hislope/gui/FilterPanel.as</string>
<key>documents</key>
<array>
<dict>
Expand Down Expand Up @@ -472,30 +472,14 @@
<key>caret</key>
<dict>
<key>column</key>
<integer>9</integer>
<integer>32</integer>
<key>line</key>
<integer>233</integer>
<integer>39</integer>
</dict>
<key>columnSelection</key>
<false/>
<key>firstVisibleColumn</key>
<integer>0</integer>
<key>firstVisibleLine</key>
<integer>208</integer>
<key>selectFrom</key>
<dict>
<key>column</key>
<integer>3</integer>
<key>line</key>
<integer>233</integer>
</dict>
<key>selectTo</key>
<dict>
<key>column</key>
<integer>9</integer>
<key>line</key>
<integer>233</integer>
</dict>
<integer>0</integer>
</dict>
<key>src/hislope/gui/Histogram.as</key>
<dict>
Expand All @@ -516,9 +500,9 @@
<key>caret</key>
<dict>
<key>column</key>
<integer>2</integer>
<integer>29</integer>
<key>line</key>
<integer>71</integer>
<integer>37</integer>
</dict>
<key>firstVisibleColumn</key>
<integer>0</integer>
Expand Down Expand Up @@ -637,6 +621,8 @@
</array>
<key>showFileHierarchyDrawer</key>
<false/>
<key>showFileHierarchyPanel</key>
<true/>
<key>treeState</key>
<dict>
<key>HiSlope</key>
Expand All @@ -648,6 +634,6 @@
</dict>
</dict>
<key>windowFrame</key>
<string>{{10, 62}, {1401, 816}}</string>
<string>{{133, 362}, {1401, 816}}</string>
</dict>
</plist>
Empty file removed index.html
Empty file.
19 changes: 14 additions & 5 deletions src/hislope/gui/FilterPanel.as
Expand Up @@ -12,7 +12,7 @@
You may NOT charge anything for this source code.
This notice and the copyright information must be left intact in any distribution of this source code.
You are encouraged to release any improvements back to the ActionScript community.w
You are encouraged to release any improvements back to the ActionScript community.
VERSION HISTORY:
v0.1 Born on 09/07/2009
Expand Down Expand Up @@ -195,7 +195,7 @@ package hislope.gui

resetButton = new PushButton(window.content, 10, offsetY + 5, "RESET", resetParams);
resetButton.setSize(50, 15);
rndButton = new PushButton(window.content, 10 + 60, offsetY + 5, "RANDOMISE", randomiseParams);
rndButton = new PushButton(window.content, 10 + 60, offsetY + 5, "RANDOMISE", onRandomise);
rndButton.setSize(70, 15);
copyParamsButton = new PushButton(window.content, 140 + 10, offsetY + 5, "COPY PARAMS", copyParams);
copyParamsButton.setSize(80, 15);
Expand Down Expand Up @@ -224,7 +224,6 @@ package hislope.gui
}

vbox.addChild(previewBmp);

vbox.addChild(histogram);

var line:Shape = new Shape();
Expand Down Expand Up @@ -286,6 +285,11 @@ package hislope.gui

// EVENT HANDLERS /////////////////////////////////////////////////////////////////////

private function onRandomise(event:MouseEvent):void
{
randomiseParams();
}

private function render(event:Event):void
{
updateTime();
Expand Down Expand Up @@ -385,11 +389,14 @@ package hislope.gui
filter.resetParams();
}

private function randomiseParams(event:Event = null):void
public function randomiseParams(coloursOnly:Boolean = false):void
{
for each (var param:Object in filter.params)
{
if (param.type == "button") continue;
if (coloursOnly && !(param.type == "rgb" || param.type == "hex" || param.type == "color")) continue;

if (!coloursOnly && param.lock) continue;

var min:Number = param.min;
var max:Number = param.max;
Expand All @@ -413,7 +420,9 @@ package hislope.gui

for each (var param:Object in filter.params)
{
var object:String = param.name + ": " + filter.getParamValue(param.name);
if (param.type == "button") continue;

var object:String = param.name + ": " + filter.getParamValue(param.name).toFixed(3);

if (param.type == "rgb" || param.type == "hex" || param.type == "color")
{
Expand Down

0 comments on commit b0b619c

Please sign in to comment.