tests/wxHMI/HMI@wxglade_hmi/hmi.wxg.bak
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Fri, 10 Mar 2017 17:09:48 +0300
changeset 1661 78f28f40bc10
parent 1461 954d1f42d42d
permissions -rw-r--r--
wrap Beremiz startup code into separate launcher class

this should make it easier to make customized version of Beremiz IDE.
It's easy to add own splash, change version, add/disable extensions
and many other things.

For example:

[----- MyBeremiz.py ------]
#!/usr/bin/env python
from BeremizIDELauncher import BeremizIDELauncher

class MyBeremizIDELauncher(BeremizIDELauncher):
def __init__(self):
BeremizIDELauncher.__init__(self)
self.splashPath = self.Bpath("", "splash.png")

def ShowSplashScreen(self):
# comment next line to disable splash entirely
BeremizIDELauncher.ShowSplashScreen(self)

# change version
import version
version.app_version = "3.141-rc52"

def LoadExtensions(self):
# add/modifine list of extensions
# in self.extensions
BeremizIDELauncher.LoadExtensions(self)

if __name__ == '__main__':
beremiz = MyBeremizIDELauncher()
beremiz.Start()

[-------------------------]
<?xml version="1.0"?>
<!-- generated by wxGlade HG on Wed Oct 02 23:48:24 2013 -->

<application path="" name="" class="" option="0" language="python" top_window="wxglade_hmi" encoding="UTF-8" use_gettext="0" overwrite="0" use_new_namespace="1" for_version="2.8" is_template="0" indent_amount="4" indent_symbol="space" source_extension=".cpp" header_extension=".h">
    <object class="Class_wxglade_hmi" name="wxglade_hmi" base="EditFrame">
        <style>wxCAPTION|wxCLOSE_BOX|wxMINIMIZE_BOX|wxMAXIMIZE|wxMAXIMIZE_BOX|wxSYSTEM_MENU|wxRESIZE_BORDER|wxCLIP_CHILDREN</style>
        <title>frame_1</title>
        <object class="wxFlexGridSizer" name="grid_sizer_1" base="EditFlexGridSizer">
            <hgap>0</hgap>
            <growable_rows>0</growable_rows>
            <rows>1</rows>
            <growable_cols>0</growable_cols>
            <cols>2</cols>
            <vgap>0</vgap>
            <object class="sizeritem">
                <flag>wxEXPAND</flag>
                <border>0</border>
                <option>1</option>
                <object class="ThreeDee" name="window_1" base="CustomWidget">
                    <arguments>
                        <argument>$parent</argument>
                        <argument>$id</argument>
                    </arguments>
                    <size>400,400</size>
                </object>
            </object>
            <object class="sizeritem">
                <flag>wxEXPAND</flag>
                <border>0</border>
                <option>1</option>
                <object class="wxFlexGridSizer" name="sizer_1" base="EditFlexGridSizer">
                    <hgap>0</hgap>
                    <rows>2</rows>
                    <cols>1</cols>
                    <vgap>0</vgap>
                    <object class="sizeritem">
                        <flag>wxEXPAND</flag>
                        <border>0</border>
                        <option>1</option>
                        <object class="wxBoxSizer" name="sizer_2" base="EditBoxSizer">
                            <orient>wxVERTICAL</orient>
                            <object class="sizerslot" />
                            <object class="sizerslot" />
                            <object class="sizerslot" />
                            <object class="sizerslot" />
                        </object>
                    </object>
                    <object class="sizeritem">
                        <flag>wxEXPAND</flag>
                        <border>0</border>
                        <option>1</option>
                        <object class="wxGridSizer" name="sizer_3" base="EditGridSizer">
                            <hgap>0</hgap>
                            <rows>4</rows>
                            <cols>2</cols>
                            <vgap>0</vgap>
                            <object class="sizerslot" />
                            <object class="sizerslot" />
                            <object class="sizerslot" />
                            <object class="sizerslot" />
                            <object class="sizerslot" />
                            <object class="sizerslot" />
                            <object class="sizerslot" />
                            <object class="sizerslot" />
                        </object>
                    </object>
                </object>
            </object>
        </object>
    </object>
</application>