| 1884 | } |
| 1885 | |
| 1886 | void CAUIEditorParser::parseViewControllItems(CAViewController* viewController) |
| 1887 | { |
| 1888 | m_pViewController = viewController; |
| 1889 | |
| 1890 | CC_RETURN_IF(!m_pMyDocument); |
| 1891 | |
| 1892 | tinyxml2::XMLElement* rootElement = m_pMyDocument->RootElement(); |
| 1893 | |
| 1894 | tinyxml2::XMLElement* entity = NULL; |
| 1895 | |
| 1896 | entity = rootElement->FirstChildElement("CATabBarItem"); |
| 1897 | |
| 1898 | if (entity) |
| 1899 | { |
| 1900 | //CATabBarItem |
| 1901 | std::string barTitle = ""; |
| 1902 | CAImage* image = NULL; |
| 1903 | CAImage* selectImage = NULL; |
| 1904 | |
| 1905 | if (const char* value = entity->Attribute("image")) |
| 1906 | { |
| 1907 | image = CAImage::create(value); |
| 1908 | } |
| 1909 | if (const char* value = entity->Attribute("selectImage")) |
| 1910 | { |
| 1911 | selectImage = CAImage::create(value); |
| 1912 | } |
| 1913 | if (const char* value = entity->Attribute("title")) |
| 1914 | { |
| 1915 | barTitle = value; |
| 1916 | } |
| 1917 | CATabBarItem* item = CATabBarItem::create(barTitle, image, selectImage); |
| 1918 | if (const char* value = entity->Attribute("badgeValue")) |
| 1919 | { |
| 1920 | item->setBadgeValue(value); |
| 1921 | } |
| 1922 | |
| 1923 | viewController->setTabBarItem(item); |
| 1924 | } |
| 1925 | |
| 1926 | entity = rootElement->FirstChildElement("CANavigationBarItem"); |
| 1927 | if (entity) |
| 1928 | { |
| 1929 | //CANavigationItem |
| 1930 | |
| 1931 | CANavigationBarItem* navigationBarItem = NULL; |
| 1932 | if (const char* value = entity->Attribute("title")) |
| 1933 | { |
| 1934 | navigationBarItem = CANavigationBarItem::create(value); |
| 1935 | } |
| 1936 | if (const char* value = entity->Attribute("titleImage")) |
| 1937 | { |
| 1938 | navigationBarItem->setTitleViewImage(CAImage::create(value)); |
| 1939 | } |
| 1940 | if (navigationBarItem) |
| 1941 | { |
| 1942 | tinyxml2::XMLElement* leftXml = entity->FirstChildElement(); |
| 1943 |
no test coverage detected