프로그래머의 삶 Programmer's Life/C & C++

RadioButton and CheckBox 예제~ 어느책에 있었는데....ㅡㅡ;

Oliver's World 2008. 11. 3. 17:43
728x90
<?xml version="1.0" ENCODING="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" fontSize="11"
 backgroundGradientColors="[#f7f794,#adb2ce]">
 <mx:Panel title="box test" width="100%" height="100%" layout="vertical"
 paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">
  <mx:VBox verticalAlign="middle" width="100%">
  <!-- 체크박스 선택시 myBtn 버튼의 활성화 속성을 똑같이 true또는 false바꿔준다. -->
  <mx:CheckBox id="myChk1" labelPlacement="left"
  label="왼쪽 라벨 체크 " click="myBtn.enabled=myChk1.selected"/>
  <mx:CheckBox id="myChk2" labelPlacement="right" label="오른쪽 라벨 체크"
  click="myBtn.enabled=myChk2.selected"/>
  <mx:Button label="상태확인용" id="myBtn"/>
  </mx:VBox>
  <mx:HBox borderStyle="solid">
   <mx:Label text="과일고르기"/>
   <!-- 과일을 위한 라디오버튼그룹 생성  -->
   <mx:RadioButtonGroup  id="rg1"/>
   <mx:RadioButton label="1. 포도" groupName="rg1"/>
   <mx:RadioButton label="2. 딸기" groupName="rg1"/>
   <mx:RadioButton label="3. 사과" groupName="rg1"/>
   <mx:RadioButton label="4. 배" groupName="rg1"/>
  </mx:HBox>
  <mx:HBox borderStyle="solid">
   <mx:RadioButtonGroup id="rg2"/>
   <mx:RadioButton label="1. 쥬스"  groupName="rg2"/>
   <mx:RadioButton label="2. 커피"  groupName="rg2"/>
   <mx:RadioButton label="3. 콜라"  groupName="rg2"/>
  </mx:HBox>
 </mx:Panel>
 
</mx:Application>
728x90