From: Richard K. <ric...@us...> - 2005-07-09 04:32:54
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4200 Modified Files: ASList.as ASListView.as Log Message: add ability to add multiple items at once, and optimize xml Index: ASListView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASListView.as,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ASListView.as 21 Jun 2005 01:33:09 -0000 1.6 --- ASListView.as 9 Jul 2005 04:32:41 -0000 1.7 *************** *** 104,108 **** var styleSheet:TextField.StyleSheet = new TextField.StyleSheet(); var styleText = " ! .s { color: #FFFFFF; font-family: "+m_font.fontName()+"; --- 104,108 ---- var styleSheet:TextField.StyleSheet = new TextField.StyleSheet(); var styleText = " ! s { color: #FFFFFF; font-family: "+m_font.fontName()+"; *************** *** 111,115 **** display: block; } ! .n { color: #"+m_fontColorHex+"; font-family: "+m_font.fontName()+"; --- 111,115 ---- display: block; } ! n { color: #"+m_fontColorHex+"; font-family: "+m_font.fontName()+"; *************** *** 153,159 **** for(var i = 0;i < items.length;i++) { if (items[i].isSelected()) { ! m_text += "<span class='s'>"+items[i].label()+"</span><br>"; } else { ! m_text += "<span class='n'>"+items[i].label()+"</span><br>"; } } --- 153,159 ---- for(var i = 0;i < items.length;i++) { if (items[i].isSelected()) { ! m_text += "<s>"+items[i].label()+"</s>"; } else { ! m_text += "<n>"+items[i].label()+"</n>"; } } *************** *** 161,167 **** m_textField._height = m_textField.textHeight+1; } ! ! private function checkTextField(rect:NSRect) { ! if (m_textField == null || m_textField._parent == undefined) { m_textField = createBoundsTextField(); m_textField.border = false; --- 161,168 ---- m_textField._height = m_textField.textHeight+1; } ! ! public function createMovieClips() { ! super.createMovieClips(); ! if (m_mcBounds != null) { m_textField = createBoundsTextField(); m_textField.border = false; *************** *** 176,180 **** m_textField.selectable = false; m_textField.embedFonts = m_font.isEmbedded(); ! m_textField._width = rect.size.width; updateText(); setFrameSize(new NSSize(m_list.frame().size.width, m_textField.textHeight+4)); --- 177,181 ---- m_textField.selectable = false; m_textField.embedFonts = m_font.isEmbedded(); ! m_textField._width = m_list.frame().size.width; updateText(); setFrameSize(new NSSize(m_list.frame().size.width, m_textField.textHeight+4)); *************** *** 198,202 **** public function drawRect(rect:NSRect) { - checkTextField(rect); m_mcBounds.clear(); drawSelectedItems(rect); --- 199,202 ---- Index: ASList.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASList.as,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ASList.as 20 Jun 2005 12:50:05 -0000 1.4 --- ASList.as 9 Jul 2005 04:32:41 -0000 1.5 *************** *** 170,174 **** --- 170,189 ---- return item; } + + public function addItems(items:Array):Void { + for (var i = 0;i < items.length;i++) { + m_internalList.addObject(items[i]); + } + m_listView.computeHeight(); + } + public function addItemsWithLabelsData(labels:Array, data:Array):Void { + var item:ASListItem; + for (var i = 0;i < labels.length;i++) { + m_internalList.addObject(ASListItem.listItemWithLabelData(labels[i], data[i])); + } + m_listView.computeHeight(); + } + /** * Inserts an item into the list. |