{"id":4073,"date":"2022-01-06T10:34:57","date_gmt":"2022-01-06T10:34:57","guid":{"rendered":"http:\/\/truelogic.org\/wordpress\/?p=4073"},"modified":"2022-01-06T10:34:58","modified_gmt":"2022-01-06T10:34:58","slug":"8d-wxwidgets-wxstaticline","status":"publish","type":"post","link":"https:\/\/truelogic.org\/wordpress\/2022\/01\/06\/8d-wxwidgets-wxstaticline\/","title":{"rendered":"8d.wxWidgets &#8211; wxStaticLine"},"content":{"rendered":"\n<p><strong>OVERVIEW<\/strong><\/p>\n\n\n\n<p>wxStaticLine lets you draw horizontal or vertical lines in a window. The default style is horizontal unless your specify a wxLI_VERTICAL style. For both style of lines, the wxSize parameter specifies the length. You cannot change the thickness.<\/p>\n\n\n\n<p><strong>SAMPLE CODE<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">staticline.h<\/pre>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n#include &lt;wx\/wxprec.h&gt;\n#ifndef WX_PRECOMP\n    #include &lt;wx\/wx.h&gt;\n#endif\n\nclass StaticLine: public wxFrame {\n\n    public:\n      StaticLine(const wxString &amp;title);\n\n};\n\n\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">staticline.cpp<\/pre>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n#include &quot;staticline.h&quot;\n#include &lt;wx\/statline.h&gt;\n\nStaticLine::StaticLine(const wxString &amp;title):\n\n    wxFrame(NULL, -1, title, wxDefaultPosition, wxSize(500,200)) {\n \n    wxPanel *panel = new wxPanel(this, -1);   \n    panel-&gt;SetBackgroundColour(wxColour(255,255,255)); \n\n    wxStaticLine *line1 = new wxStaticLine(panel, -1, wxPoint(10,10), wxSize(200,1));\n    wxStaticLine *line2 = new wxStaticLine(panel, -1, wxPoint(30,70), wxSize(200,1));\n    wxStaticLine *line3 = new wxStaticLine(panel, -1, wxPoint(30,70), wxSize(10,200), wxLI_VERTICAL);\n\n    Center();\n\n}\n\n\n\n\n\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">main.h<\/pre>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n#include &lt;wx\/wxprec.h&gt;\n#ifndef WX_PRECOMP\n    #include &lt;wx\/wx.h&gt;\n#endif\n\nclass Main: public wxApp {\n\n\tpublic:\n\t        virtual bool OnInit();\n};\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-preformatted\">main.cpp<\/pre>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n#include &quot;main.h&quot;\n#include &quot;staticline.h&quot;\n \nIMPLEMENT_APP(Main)\n\nbool Main::OnInit() {\n\n    StaticLine *app = new StaticLine(wxT(&quot;StaticLine&quot;));\n    app-&gt;Show(true);\n}\n\n<\/pre><\/div>\n\n\n<p>The output is shown below<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"200\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2022\/01\/Screenshot-from-2022-01-06-16-04-00.png\" alt=\"\" class=\"wp-image-4076\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2022\/01\/Screenshot-from-2022-01-06-16-04-00.png 500w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2022\/01\/Screenshot-from-2022-01-06-16-04-00-300x120.png 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>OVERVIEW wxStaticLine lets you draw horizontal or vertical lines in a window. The default style is horizontal unless your specify a wxLI_VERTICAL style. For both <a class=\"mh-excerpt-more\" href=\"https:\/\/truelogic.org\/wordpress\/2022\/01\/06\/8d-wxwidgets-wxstaticline\/\" title=\"8d.wxWidgets &#8211; wxStaticLine\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":3595,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[302,365],"tags":[],"class_list":["post-4073","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cc","category-wxwidgets"],"_links":{"self":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/4073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/comments?post=4073"}],"version-history":[{"count":4,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/4073\/revisions"}],"predecessor-version":[{"id":4078,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/4073\/revisions\/4078"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/media\/3595"}],"wp:attachment":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/media?parent=4073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/categories?post=4073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/tags?post=4073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}