{"id":91,"date":"2006-12-11T20:23:48","date_gmt":"2006-12-11T19:23:48","guid":{"rendered":"http:\/\/blog.pczone.be\/?p=91"},"modified":"2006-12-12T09:24:03","modified_gmt":"2006-12-12T08:24:03","slug":"topreader-desktop-development-2","status":"publish","type":"post","link":"https:\/\/blog.pczone.be\/?p=91","title":{"rendered":"Topreader Desktop Development (2)"},"content":{"rendered":"<p>This weekend and this evening I did some more TopReader development. I got stuck on the right mouse click popup (context menu) for creating folders,adding feeds, &#8230; I asked #gnome and <a href=\"http:\/\/www.murrayc.com\/blog\/\">Murray<\/a> pointed me to the UIManager class. I have to say this is a nifty thing!!<\/p>\n<p>For those out there who (like me) didn&#8217;t know about this <em>Factory<\/em>, it reads an xml file like the following<\/p>\n<pre>\r\n&lt;ui>\r\n  &lt;popup name=\"channelpopupmenu\" action=\"channelpopup\">\r\n    &lt;menuitem name=\"MarkRead\" action=\"MarkRead\"\/>\r\n  &lt;\/popup>\r\n  &lt;popup name=\"folderpopupmenu\" action=\"folderpopupmenu\">\t\r\n    &lt;menuitem name=\"CreateFolder\" action=\"CreateFolder\"\/>\t\r\n    &lt;menuitem name=\"AddFeed\" action=\"AddFeed\"\/>\r\n  &lt;\/popup>\r\n&lt;\/ui>\r\n<\/pre>\n<p>In your code you just do this for initializing it<\/p>\n<pre>\r\nuim = new UIManager ();\r\nuim.AddUiFromResource(\"FeedMenu.xml\");\r\n<\/pre>\n<p>And if you want to show a context menu, you intercept the right mouse click event on your widget and do this little piece of code<\/p>\n<pre>\r\nMenu w = (Menu)uim.GetWidget(\"ui\/channelpopupmenu\");\r\nw.Popup();\r\n<\/pre>\n<p>The widget is retrieved by the tagname or its actual name<br \/>\nAs easy as that!!!<\/p>\n<p>Now we take it a step further. During initalisation we do this<\/p>\n<pre>\r\nuim = new UIManager ();\r\nuim.InsertActionGroup (group, 0);\r\nuim.AddUiFromResource(\"FeedMenu.xml\");\r\n<\/pre>\n<p>Where the action group represents a group of Action objects (Duh)<\/p>\n<pre>\r\nActionEntry[] entries = new ActionEntry[] {\r\n    \t\t\tnew ActionEntry (\"MarkRead\", Stock.Cut, \"MarkRead\", null,\r\n                     \"MarkRead\",\r\n                     new EventHandler (OnMarkRead)),\r\n                new ActionEntry (\"CreateFolder\", Stock.Cut, \"CreateFolder\", null,\r\n                     \"CreateFolder\",\r\n                     new EventHandler (OnCreateFolder)),\r\n                new ActionEntry (\"AddFeed\", Stock.Cut, \"AddFeed\", null,\r\n                     \"AddFeed\",\r\n                     new EventHandler (OnAddFeed))\r\n                   };\r\n<\/pre>\n<p>I haven&#8217;t configured them as you can see, all are the Cut Stock item.<br \/>\nSo we linked the selection of the context menu item with the designed EventHandler.<\/p>\n<p>One word: <strong>SWEET<\/strong><\/p>\n<p>What can I do so far with my app, well I can create folders, add feeds, read feeds, mark a whole feed as read. In the backend the feeds get updated automatically. As I mentioned everything is stored in a small sqlite3 database, for 318 items it&#8217;s 600 k, not tho much if you ask me. I wonder how much feeds I can archive before I reach the limit of sqlite (thought that was 2 gigs,but not sure)<\/p>\n<p>I&#8217;ll keep you posted (offcourse it&#8217;s gonna be opensourced, LGPL probably as I like it more than the GPL)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This weekend and this evening I did some more TopReader development. I got stuck on the right mouse click popup (context menu) for creating folders,adding feeds, &#8230; I asked #gnome and Murray pointed me to the UIManager class. I have to say this is a nifty thing!! For those out there who (like me) didn&#8217;t &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.pczone.be\/?p=91\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Topreader Desktop Development (2)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[6,11,4,7],"tags":[],"class_list":["post-91","post","type-post","status-publish","format-standard","hentry","category-c","category-gnome","category-informatics","category-linux"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3U9nk-1t","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/blog.pczone.be\/index.php?rest_route=\/wp\/v2\/posts\/91","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.pczone.be\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.pczone.be\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.pczone.be\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.pczone.be\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=91"}],"version-history":[{"count":0,"href":"https:\/\/blog.pczone.be\/index.php?rest_route=\/wp\/v2\/posts\/91\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.pczone.be\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=91"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.pczone.be\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=91"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.pczone.be\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}