curl
Thu, 03 Jan 2008 05:31:37 -0800
I was able to get that to work as well. However the following code will not work. It may have to do with the checkbutton control being subclassed. The following control will register activity with the checkboxes, but not with the DropdownList that contains them
These are the test results:
Browser("Browser").CurlAppletView("file:///c:/Documents
and").CurlDialog("Menu").CurlCheckBox("one").Set "ON"
Browser("Browser").CurlAppletView("file:///c:/Documents
and").CurlDialog("Menu").CurlCheckBox("two").Set "ON"
Browser("Browser").CurlAppletView("file:///c:/Documents
and").CurlDialog("Menu").CurlCheckBox("three").Set "ON"
Browser("Browser").CurlAppletView("file:///c:/Documents
and").CurlDialog("Menu").CurlCheckBox("four").Set "ON"
This is the code:
{curl 6.0 applet}
{curl-file-attributes character-encoding = "windows-latin-1"}
{define-class public open CXCheckButton {inherits CheckButton}
{constructor public {default ...}
{with-compiler-directives allow-slow-spliced-arguments? = true do
{construct-super ...}
}
}
{method public open {object-describe
out:TextOutputStream,
locale:Locale
}:void
{out.write-one-string "test"}
}
}
{let title-drop-down:DropdownList = {uninitialized-value-for-type
DropdownList}}
{let ck-buttons:{Array-of CheckButton} = {new {Array-of CheckButton}}}
{set title-drop-down ={DropdownList
width = 3.5cm,
control-appearance-changeable? = true,
control-color="#6c6c6c",
cell-margin=0cm,
prompt="this is a test ddl",
color = "#173A0B",
font-size = 8pt,
{on e:ValueChanged do
{e.consume}
},
{on e:ValueFinished do
{e.consume}
},
{on e:PointerEnvelopeEvent do
{if e.contents isa PointerPress then
{if not e.consumed? then
let farray:{FastArray-of any} =
{new {FastArray-of any},
max-size=3
}
{farray.append (e.contents asa
PointerPress)}
}
}
},
{on e:GuiEvent do
}
}
}
{set title-drop-down.test-name="title-drop-down"}
||Now append checkbox items onto this list
{let items:{Array-of String} = {{Array-of String}
"one","two","three","four"}}
{for item:String in items do
let ck-button:CheckButton = {CXCheckButton
width = 4cm,
opaque-to-events? = true,
control-appearance-changeable?=true,
color = "black",
label = item,
value = false,
style = "standard",
{on ValueFinished at
btn:CheckButton do
{if btn.value then
{output btn.value}
else
{output "returned no
value"}
}
}
}
{ck-buttons.append ck-button}
let drop-down-item:ListValueItem = {ListValueItem
value="test",
{HBox ck-button}
}
{title-drop-down.append drop-down-item}
}
{value title-drop-down}
ATTENTION:
This message and any attachments are intended only for the named
recipient(s), and may contain information that is confidential, privileged,
or exempt or protected from disclosure under applicable laws and rules. If
you are not the intended recipient(s), you are notified that the
dissemination, distribution, or copying of this message and any attachments
is strictly prohibited. If you receive this message in error, or are not
the named recipient(s), please notify the sender at either the email
address or the telephone number included herein and delete this message and
any of its attachments from your computer and/or network. Receipt by anyone
other than the named recipient(s) is not a waiver of any attorney-client,
work product, or other applicable privilege, protection, or doctrine. Thank
you.
This message and any attachments are covered by the Electronic
Communications Privacy Act, 18 U.S.C SS 2510-2521.
ATTENTION:
This message and any attachments are intended only for the named recipient(s),
and may contain information belonging to Paisley or others that is
confidential, privileged, or exempt or protected from disclosure under
applicable laws and rules. If you are not the intended recipient(s), you are
notified that the dissemination, distribution, or copying of this message and
any attachments is strictly prohibited. If you receive this message in error,
or are not the named recipient(s), please notify the sender at either the email
address or the telephone number included herein and delete this message and any
of its attachments from your computer and/or network. Receipt by anyone other
than the named recipient(s) is not a waiver of any confidentiality,
attorney-client, work product, or other applicable privilege, protection, or
doctrine. Thank you.
This message and any attachments are covered by the Electronic Communications
Privacy Act, 18 U.S.C SS 2510-2521.