OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 2 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 | 942 |
943 // if this index is already selected, unselect. otherwise update the selecte
d index | 943 // if this index is already selected, unselect. otherwise update the selecte
d index |
944 const Vector<Element*>& items = data.listItems(element); | 944 const Vector<Element*>& items = data.listItems(element); |
945 int listIndex = optionToListIndex(data, element, index); | 945 int listIndex = optionToListIndex(data, element, index); |
946 if (OptionElement* optionElement = (listIndex >= 0 ? toOptionElement(items[l
istIndex]) : 0)) { | 946 if (OptionElement* optionElement = (listIndex >= 0 ? toOptionElement(items[l
istIndex]) : 0)) { |
947 if (optionElement->selected()) | 947 if (optionElement->selected()) |
948 optionElement->setSelectedState(false); | 948 optionElement->setSelectedState(false); |
949 else | 949 else |
950 setSelectedIndex(data, element, index, false, true); | 950 setSelectedIndex(data, element, index, false, true); |
951 } | 951 } |
952 | 952 |
953 listBoxOnChange(data, element); | 953 if (data.usesMenuList()) |
| 954 menuListOnChange(data, element); |
| 955 else |
| 956 listBoxOnChange(data, element); |
| 957 |
954 scrollToSelection(data, element); | 958 scrollToSelection(data, element); |
955 } | 959 } |
956 | 960 |
957 unsigned SelectElement::optionCount(const SelectElementData& data, const Element
* element) | 961 unsigned SelectElement::optionCount(const SelectElementData& data, const Element
* element) |
958 { | 962 { |
959 unsigned options = 0; | 963 unsigned options = 0; |
960 | 964 |
961 const Vector<Element*>& items = data.listItems(element); | 965 const Vector<Element*>& items = data.listItems(element); |
962 for (unsigned i = 0; i < items.size(); ++i) { | 966 for (unsigned i = 0; i < items.size(); ++i) { |
963 if (isOptionElement(items[i])) | 967 if (isOptionElement(items[i])) |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1027 | 1031 |
1028 #if ENABLE(WML) | 1032 #if ENABLE(WML) |
1029 if (element->isWMLElement() && element->hasTagName(WMLNames::selectTag)) | 1033 if (element->isWMLElement() && element->hasTagName(WMLNames::selectTag)) |
1030 return static_cast<WMLSelectElement*>(element); | 1034 return static_cast<WMLSelectElement*>(element); |
1031 #endif | 1035 #endif |
1032 | 1036 |
1033 return 0; | 1037 return 0; |
1034 } | 1038 } |
1035 | 1039 |
1036 } | 1040 } |
OLD | NEW |