Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // $parent - the parent UI layout
- // $action - "post" or "query"
- // $initialSettings - the initial exporter settings
- // $resultCallback - the function to call
- //
- global proc int ExportThatTimeOptions( string $parent,
- string $action,
- string $initialSettings,
- string $resultCallback ) {
- int $result;
- string $currentOptions;
- string $optionList[];
- string $optionBreakDown[];
- int $index;
- // if we need to create the user interface...
- if ($action == "post") {
- setParent $parent;
- columnLayout -adj true;
- radioButtonGrp
- -l "Time Mode"
- -nrb 2 -cw3 175 75 75
- -la2 "0" "1" timeMode;
- textFieldGrp
- -l "Format String" formatString;
- if (size($initialSettings) > 0) {
- tokenize($initialSettings, ";", $optionList);
- for ($index = 0; $index < size($optionList); $index++) {
- tokenize($optionList[$index], "=", $optionBreakDown);
- if ($optionBreakDown[0] == "m") {
- if ($optionBreakDown[1] == "0") {
- radioButtonGrp -e -sl 1 timeMode;
- } else {
- radioButtonGrp -e -sl 2 timeMode;
- }
- } else if ($optionBreakDown[0] == "strfrmt") {
- textFieldGrp -e -text $optionBreakDown[1] formatString;
- }
- }
- }
- $result = 1;
- } else if ($action == "query") {
- if (`radioButtonGrp -q -sl timeMode` == 2) {
- $currentOptions = $currentOptions + "m=1";
- } else {
- $currentOptions = $currentOptions + "m=0";
- }
- string $frmtString = `textFieldGrp -q -text formatString`;
- if (`size $frmtString` > 1) {
- $currentOptions = $currentOptions + ";strfrmt="+$frmtString;
- }
- eval($resultCallback+" \""+$currentOptions+"\"");
- $result = 1;
- } else {
- $result = 0;
- }
- return $result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement