Advertisement
sharath

Untitled

Aug 30th, 2013
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.09 KB | None | 0 0
  1. Tab {
  2.  
  3. imageSource: "asset:///images/share_icon.png"
  4. NavigationPane {
  5. id: navTab
  6. Page {
  7. id:sharePage
  8. ScrollView {
  9. Container {
  10. layout: StackLayout {
  11. orientation: LayoutOrientation.TopToBottom
  12. }
  13. background: Color.Black
  14. Container {
  15. layout: DockLayout {
  16. }
  17. leftPadding: 15.0
  18. rightPadding: 15.0
  19. horizontalAlignment: HorizontalAlignment.Fill
  20. background: Color.create("#f9393b30")
  21. ImageView {
  22. imageSource: "asset:///images/title.png"
  23. horizontalAlignment: HorizontalAlignment.Center
  24. maxHeight: 250
  25. maxWidth: 300
  26. scaleX: 0.5
  27. scaleY: 0.5
  28. }
  29. Button {
  30. horizontalAlignment: HorizontalAlignment.Right
  31.  
  32. imageSource: "asset:///images/settings_button_icon.png"
  33. //
  34. preferredWidth: 10.0
  35. preferredHeight: 10.0
  36. leftPadding: 100
  37.  
  38. contextActions: [
  39. ActionSet {
  40. title: "Share Settings"
  41. actions: [
  42. ActionItem {
  43. title: "Add/Delete Symbols"
  44.  
  45. onTriggered: {
  46.  
  47. var add_Delete = addOrDelete.createObject();
  48. // var add_Delete=_app.getDropDownSymbols();
  49. add_Delete.appPage_ID =
  50. { 'id': navTab ,'title': 'Share'};
  51.  
  52. navTab.push(add_Delete);
  53. //navTab.push(addOrDelete.createObject());
  54. }
  55. imageSource: "asset:///images/add_button.png"
  56. },
  57. ActionItem {
  58. title: "Alerts"
  59. onTriggered: {
  60. var alerts = alertsPage.createObject();
  61. alerts.alerts_ID = {
  62. 'id': navTab
  63. };
  64. navTab.push(alerts);
  65. //navTab.push(alertsPage.createObject());
  66. }
  67. imageSource: "asset:///images/alert_title_icon.png"
  68. },
  69. ActionItem {
  70. title: "Portfolio"
  71. onTriggered: {
  72. var port_page= portfolio.createObject();
  73. port_page.data_ID={'id':navTab};
  74. navTab.push(port_page);
  75. }
  76. imageSource: "asset:///images/portfolio_title_icon.png"
  77.  
  78. },
  79. ActionItem {
  80. title: "News Feeds"
  81. onTriggered: {
  82. var feeds= newsFeeds.createObject();
  83. feeds.navId={
  84. 'id': navTab
  85. }
  86. navTab.push(feeds);
  87. }
  88. imageSource: "asset:///images/news_feed_icon.png"
  89.  
  90. },
  91. ActionItem {
  92. title: "Exit Application"
  93. onTriggered: {
  94. _app.exitApp();
  95.  
  96. }
  97.  
  98. imageSource: "asset:///images/exit_icon.png"
  99. }
  100.  
  101. ]
  102. } // end of ActionSet
  103. ]
  104.  
  105. }
  106. }
  107.  
  108. Container {
  109.  
  110. layout: StackLayout {
  111.  
  112. }
  113. leftPadding: 15.0
  114. rightPadding: 15.0
  115. background: Color.create("#00a3b8")
  116. horizontalAlignment: HorizontalAlignment.Fill
  117.  
  118. Label {
  119. text: "Share"
  120. textStyle.color: Color.White
  121. }
  122.  
  123. }
  124. Container {
  125. leftPadding: 15.0
  126. rightPadding: 15.0
  127. layout: StackLayout {
  128. orientation: LayoutOrientation.LeftToRight
  129. }
  130. topPadding: 20.0
  131.  
  132. Label {
  133. id: symbolTop
  134. text: "Symbol"
  135. // Text Style and size etc
  136. textStyle.base: SystemDefaults.TextStyles.SubtitleText
  137. textStyle.fontSizeValue: 30.0
  138. layoutProperties: StackLayoutProperties {
  139. spaceQuota: 4.0
  140. }
  141. verticalAlignment: VerticalAlignment.Center
  142. horizontalAlignment: HorizontalAlignment.Center
  143. textStyle.color: Color.White
  144. }
  145. Label {
  146. id: changePer
  147. text: "Change %"
  148.  
  149. textStyle.base: SystemDefaults.TextStyles.SubtitleText
  150. textStyle.fontSizeValue: 30.0
  151.  
  152. layoutProperties: StackLayoutProperties {
  153. spaceQuota: 2.0
  154. }
  155. verticalAlignment: VerticalAlignment.Center
  156. horizontalAlignment: HorizontalAlignment.Center
  157. textStyle.color: Color.White
  158.  
  159. }
  160. Label {
  161. id: ltpTop
  162. text: "LTP"
  163. textStyle.base: SystemDefaults.TextStyles.SubtitleText
  164. textStyle.fontSizeValue: 30.0
  165. layoutProperties: StackLayoutProperties {
  166. spaceQuota: 1.0
  167. }
  168. verticalAlignment: VerticalAlignment.Center
  169. horizontalAlignment: HorizontalAlignment.Center
  170. textStyle.color: Color.White
  171. }
  172. Label {
  173. id: high
  174. text: "High"
  175. textStyle.base: SystemDefaults.TextStyles.SubtitleText
  176. textStyle.fontSizeValue: 30.0
  177. layoutProperties: StackLayoutProperties {
  178. spaceQuota: 1.0
  179. }
  180. verticalAlignment: VerticalAlignment.Center
  181. horizontalAlignment: HorizontalAlignment.Center
  182. textStyle.color: Color.White
  183. }
  184. Label {
  185. id: low
  186. text: "Low"
  187. textStyle.base: SystemDefaults.TextStyles.SubtitleText
  188. textStyle.fontSizeValue: 30.0
  189. layoutProperties: StackLayoutProperties {
  190. spaceQuota: 1.0
  191. }
  192. verticalAlignment: VerticalAlignment.Center
  193. horizontalAlignment: HorizontalAlignment.Center
  194. textStyle.color: Color.White
  195. }
  196.  
  197. }
  198.  
  199.  
  200. //Integrating
  201. Container {
  202. layout: StackLayout {
  203. orientation: LayoutOrientation.LeftToRight
  204. }
  205.  
  206. ListView {
  207. id: tradeList
  208. objectName: "tradeList"
  209. dataModel: _app.dataModel
  210. listItemComponents: [
  211. ListItemComponent {
  212. type: "header"
  213. Header {
  214. title: {
  215. ListItemData
  216. }
  217. }
  218. },
  219.  
  220. // The tradeList Item
  221. ListItemComponent {
  222. type: "item"
  223. // StandardListItem {
  224. // title: ListItemData.Symbol + ' ' + ListItemData.PerChange +' '+
  225. // ListItemData.LTP
  226. // }
  227.  
  228. Container {
  229. leftPadding: 15.0
  230. rightPadding: 15.0
  231. layout: StackLayout {
  232. orientation: LayoutOrientation.LeftToRight
  233. }
  234. topPadding: 20.0
  235.  
  236. Label {
  237. id: symbol
  238. text: ListItemData.Symbol_En
  239. //text: ListItemData.Symbol_En.length()>20?Symbol_En.subString(0,15): Symbol_En
  240.  
  241. // Text Style and size etc
  242. textStyle.base: SystemDefaults.TextStyles.SubtitleText
  243. textStyle.fontSizeValue: 30.0
  244. layoutProperties: StackLayoutProperties {
  245. spaceQuota: 3.8
  246. }
  247. verticalAlignment: VerticalAlignment.Center
  248. horizontalAlignment: HorizontalAlignment.Center
  249. textStyle.color: Color.White
  250. }
  251. Label {
  252. id: change
  253. text: ListItemData.PerChange
  254. textStyle.color: ListItemData.PerChange.indexOf('-') < 0 ? Color.Green : Color.Red //here
  255. textStyle.base: SystemDefaults.TextStyles.SubtitleText
  256. textStyle.fontSizeValue: 30.0
  257. layoutProperties: StackLayoutProperties {
  258. spaceQuota: 2
  259. }
  260. verticalAlignment: VerticalAlignment.Center
  261. horizontalAlignment: HorizontalAlignment.Center
  262.  
  263. }
  264. Label {
  265. id: ltp
  266. text: ListItemData.LTP
  267. textStyle.base: SystemDefaults.TextStyles.SubtitleText
  268. textStyle.fontSizeValue: 30.0
  269. layoutProperties: StackLayoutProperties {
  270. spaceQuota: 1
  271. }
  272. verticalAlignment: VerticalAlignment.Center
  273. horizontalAlignment: HorizontalAlignment.Center
  274. textStyle.color: Color.White
  275. }
  276. Label {
  277. id: highValue
  278. text: ListItemData.High
  279. textStyle.base: SystemDefaults.TextStyles.SubtitleText
  280. textStyle.fontSizeValue: 30.0
  281. layoutProperties: StackLayoutProperties {
  282. spaceQuota: 1
  283. }
  284. verticalAlignment: VerticalAlignment.Center
  285. horizontalAlignment: HorizontalAlignment.Center
  286. textStyle.color: Color.White
  287. }
  288. Label {
  289. id: lowValue
  290. text: ListItemData.Low
  291. textStyle.base: SystemDefaults.TextStyles.SubtitleText
  292. textStyle.fontSizeValue: 30.0
  293. layoutProperties: StackLayoutProperties {
  294. spaceQuota: 1
  295. }
  296. verticalAlignment: VerticalAlignment.Center
  297. horizontalAlignment: HorizontalAlignment.Center
  298. textStyle.color: Color.White
  299. }
  300. }
  301. }
  302. ]
  303. onTriggered: {
  304. var quick_chart = quickView.createObject();
  305. quick_chart.chart_ID = {
  306. 'id': navTab
  307. };
  308. navTab.push(quick_chart);
  309. var selectedItem = dataModel.data(indexPath);
  310. textField.text = selectedItem.status;
  311.  
  312. }
  313. }
  314. Timer {
  315. id: lightTimer
  316. // Specify a timeout interval of 1 second
  317. interval: 1000
  318. onTimeout: {
  319. // call method Qinvikable to load records
  320. _app.readRecords();
  321.  
  322. } // end of onTimeout signal handler
  323.  
  324. } // end of Timer
  325. }
  326.  
  327. }
  328. }
  329. }
  330. onCreationCompleted: {
  331. lightTimer.start();
  332. _app.reqForSymbols(1);
  333. }
  334.  
  335. }
  336. onTriggered: {
  337.  
  338. _app.dropSymbols(2);
  339. _app.clearModel();
  340. // lightTimer2.stop();
  341. _app.reqForSymbols(1);
  342.  
  343. lightTimer.start();
  344.  
  345. }
  346. attachedObjects: [
  347. ComponentDefinition {
  348. id: quickView
  349. source: "QuickORChartview.qml"
  350. },
  351. ComponentDefinition {
  352. id: alertsPage
  353. source: "AlertsPage.qml"
  354. },
  355. ComponentDefinition {
  356. id: portfolio
  357. source: "portfolio.qml"
  358. },
  359. ComponentDefinition {
  360. id: addOrDelete
  361. source: "AddOrDelete.qml"
  362. },
  363. ComponentDefinition {
  364. id: newsFeeds
  365. source: "FeedsHome.qml"
  366. },
  367. ComponentDefinition {
  368. id: exitApp
  369.  
  370. }
  371. ]
  372.  
  373. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement