Design a complex dialog

Hello NG,

I'm a little overcharged with following task:

I'd like to make a dialog, which seems rather complex to me.
(taken from the "Groups List" from XPN)
I have 2 screenshots:

The initial size:
http://mitglied.lycos.de/drpython/test/Dialog_default_size.png

and a larger sized one:
http://mitglied.lycos.de/drpython/test/Dialog_larger.png

I have to use the StaticBoxSizer, but the interaction
with nested sizers, I do not know:
a) what sizers (are boxsizers enough)?
b) how to arrange them

many thanks in advance!

···

--
Franz Steinhaeusler

You could make that with just boxsizers . . . I'm not actually sure
any other kind would come out the same way. I'm not exactly sure where
the EXPAND flags would have to go to mimic that growth behavior, I
haven't gotten to a point where I don't have to futz around and
experiment with that, but here's the heirarchy of sizers and controls
that I'm seeing there:

Vertical Box
+ Horizontal Box
++ Vertical Static Box "List"
+++ Horizontal Box
++++ Textbox
++++ Button "Search Group"
+++ Checkbox "Preform Live Search"
+++ Checkbox "Use Regular Expression"
+++ Button "Show Full List"
+++ List Control "NewsGroups|Mode"
++ Vertical Box
+++ Horizontal Box
++++ Horizontal Static Box "Server"
+++++ Button "Get Newsgroups List"
+++++ Static Text "news.gmane.org | 119"
++++ Any Static Box "Articles Number"
+++++ Twirl Box "500"
+++ Horizontal Static Box "Subscribed Groups"
++++ Vertical Box
+++++ Spacer
+++++ Button with Right Arrow
+++++ Spacer
+++++ Button with Left Arrow
+++++ Spacer
++++ Vertical Box
+++++ List Control "NewsGroups|Articles"
+++++ Horizontal Box
++++++ Textbox
++++++ Button "Subscribe"
+ Button "OK"

···

On 9/29/06, Franz Steinhaeusler <franz.steinhaeusler@gmx.at> wrote:

I'm a little overcharged with following task:

I'd like to make a dialog, which seems rather complex to me.
(taken from the "Groups List" from XPN)
I have 2 screenshots:

The initial size:
http://mitglied.lycos.de/drpython/test/Dialog_default_size.png

and a larger sized one:
http://mitglied.lycos.de/drpython/test/Dialog_larger.png

I have to use the StaticBoxSizer, but the interaction
with nested sizers, I do not know:
a) what sizers (are boxsizers enough)?
b) how to arrange them

Franz Steinhaeusler wrote:

Hello NG,

I'm a little overcharged with following task:

I'd like to make a dialog, which seems rather complex to me.
(taken from the "Groups List" from XPN)
I have 2 screenshots:

The initial size:
http://mitglied.lycos.de/drpython/test/Dialog_default_size.png

and a larger sized one:
http://mitglied.lycos.de/drpython/test/Dialog_larger.png

I have to use the StaticBoxSizer, but the interaction
with nested sizers, I do not know:
a) what sizers (are boxsizers enough)?
b) how to arrange them

For a fun little wake-up-the-brain activity, I whipped it out in XRC for you.

NGSubscribe.xrc (7.49 KB)

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Star Weaver wrote:

···

On 9/29/06, Franz Steinhaeusler <franz.steinhaeusler@gmx.at> wrote:

I'm a little overcharged with following task:

I'd like to make a dialog, which seems rather complex to me.
(taken from the "Groups List" from XPN)
I have 2 screenshots:

The initial size:
http://mitglied.lycos.de/drpython/test/Dialog_default_size.png

and a larger sized one:
http://mitglied.lycos.de/drpython/test/Dialog_larger.png

I have to use the StaticBoxSizer, but the interaction
with nested sizers, I do not know:
a) what sizers (are boxsizers enough)?
b) how to arrange them

You could make that with just boxsizers . . . I'm not actually sure
any other kind would come out the same way. I'm not exactly sure where
the EXPAND flags would have to go to mimic that growth behavior, I
haven't gotten to a point where I don't have to futz around and
experiment with that, but here's the heirarchy of sizers and controls
that I'm seeing there:

Vertical Box
+ Horizontal Box
++ Vertical Static Box "List"
+++ Horizontal Box
++++ Textbox
++++ Button "Search Group"
+++ Checkbox "Preform Live Search"
+++ Checkbox "Use Regular Expression"
+++ Button "Show Full List"
+++ List Control "NewsGroups|Mode"
++ Vertical Box
+++ Horizontal Box
++++ Horizontal Static Box "Server"
+++++ Button "Get Newsgroups List"
+++++ Static Text "news.gmane.org | 119"
++++ Any Static Box "Articles Number"
+++++ Twirl Box "500"
+++ Horizontal Static Box "Subscribed Groups"
++++ Vertical Box
+++++ Spacer
+++++ Button with Right Arrow
+++++ Spacer
+++++ Button with Left Arrow
+++++ Spacer
++++ Vertical Box
+++++ List Control "NewsGroups|Articles"
+++++ Horizontal Box
++++++ Textbox
++++++ Button "Subscribe"
+ Button "OK"

Star Weaver, thank you very much for your effort,
I have to digest this! :slight_smile:

--
Franz Steinhaeusler

WOW, thank you VERY much!

Did it take a long time?

BTW:
Would it make sense/ much effort to make/epand the XRC
program to make an option to output the code to wxpython code directly?

But that willl be a tall order, I suppose. :slight_smile:

···

On Fri, 29 Sep 2006 11:14:03 -0700, Robin Dunn <robin@alldunn.com> wrote:

Franz Steinhaeusler wrote:

Hello NG,

I'm a little overcharged with following task:

I'd like to make a dialog, which seems rather complex to me.
(taken from the "Groups List" from XPN)
I have 2 screenshots:

The initial size:
http://mitglied.lycos.de/drpython/test/Dialog_default_size.png

and a larger sized one:
http://mitglied.lycos.de/drpython/test/Dialog_larger.png

I have to use the StaticBoxSizer, but the interaction
with nested sizers, I do not know:
a) what sizers (are boxsizers enough)?
b) how to arrange them

For a fun little wake-up-the-brain activity, I whipped it out in XRC for
you.

--
Franz Steinhaeusler

Franz Steinhäusler <franz.steinhaeusler <at> gmx.at> writes:

>For a fun little wake-up-the-brain activity, I whipped it out in XRC for
>you.

WOW, thank you VERY much!

Did it take a long time?

I don't think so. I would guess 5 min. if you're familiar with sizers.

BTW:
Would it make sense/ much effort to make/epand the XRC
program to make an option to output the code to wxpython code directly?

The script pywxrc will do that for you. I don't know if it comes with wPython
but you'll find links on the list. But dynaimcally loading the GUI from xrc is
very easy. Have a look at the wiki.

Christian

I've contemplated writing an XRC -> Python converter, but getting a
converter for all of the different objects, sizers, etc., was a bit more
than I wanted to make happen.

- Josiah

···

Franz Steinhäusler <franz.steinhaeusler@gmx.at> wrote:

WOW, thank you VERY much!

Did it take a long time?

BTW:
Would it make sense/ much effort to make/epand the XRC
program to make an option to output the code to wxpython code directly?

But that willl be a tall order, I suppose. :slight_smile:

Here's a picture of the widget...
I'm not sure the name for this kind of construction.

http://kelargo15851.tripod.com/widget.JPG

Its dynamic and has little plus/minus symbol to
expand the view... and zoom into data...

thanks
Ken

hello

···

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Kenneth,

I think the widget you need to look at is TreeListCtrl.

Best regards,

Nizam Sayeed

Kenneth Long wrote:

···

Here's a picture of the widget... I'm not sure the name for this kind of construction.

http://kelargo15851.tripod.com/widget.JPG

Its dynamic and has little plus/minus symbol to expand the view... and zoom into data...

thanks
Ken

hello

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.407 / Virus Database: 268.12.9/458 - Release Date: 9/27/2006

I think the widget you need to look at is
TreeListCtrl.

Thanks Nizam! know any example XRC files?

hello

···

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around

Franz Steinhäusler wrote:

[...]

WOW, thank you VERY much!

Did it take a long time?

BTW:
Would it make sense/ much effort to make/epand the XRC
program to make an option to output the code to wxpython code directly?

But that willl be a tall order, I suppose. :slight_smile:

Hi NG,

for the record and if someone has a similar task,
I will show the program "converted" to pure python code.
I took almost 3 hours (I didn't have almost no hunch about XRC
and sizer for me, they were always a little "suspect". :wink:

XRC is a great program and one have a nice hierarchy about
controls and sizers.

my tip on creating such a not so simple dialog:
comment everything out in the development, which
is uninteresting at the moment.

For easier comparision, I append again Robins XRC
Output (Also for people who have problems saving attachments).

#begin
#NGSubscribeDialog.py

#thanks to Robin Dunn for the creation of the dialog
#using XRC Resource Editor, 29.09.2006
#I (Franz Steinhaeusler) implemented it in pure Python code 30.09.2006.
#maybe make better: the tab order
#but for overview, creation of the dialog this way (this order
#of creating the widgets) it looks better, I think.

import wx

class GroupsListDlg(wx.Dialog):
    """Newsgroupl List Dialog"""
    def __init__(self):
        """Create the Newsgroupl List Dialog"""
        wx.Dialog.__init__(self, None, style=wx.DEFAULT_DIALOG_STYLE|
            wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,
            title = "NewsGroups")

        self.SubscribeManualTC = wx.TextCtrl(self)
        self.SubscribeManualBtn = wx.Button(self, label="Subscribe Manually")
        boxsizer1 = wx.BoxSizer(wx.HORIZONTAL)
        boxsizer1.Add(self.SubscribeManualTC, 1, wx.ALIGN_CENTRE_VERTICAL, 0)
        boxsizer1.Add(self.SubscribeManualBtn, 0, wx.LEFT, 4)

        boxsizer2 = wx.BoxSizer(wx.VERTICAL)
        self.SubscribedGroupsLC = wx.ListCtrl(self, style=wx.LC_REPORT)
        boxsizer2.Add(self.SubscribedGroupsLC, 1, wx.EXPAND, 0)
        boxsizer2.Add(boxsizer1, 0, wx.TOP|wx.EXPAND, 4)

        boxsizer3 = wx.BoxSizer(wx.VERTICAL)
        self.AddBtn = wx.BitmapButton(self, bitmap=wx.ArtProvider.GetBitmap(wx.ART_GO_FORWARD))
        self.RemoveBtn = wx.BitmapButton(self, bitmap=wx.ArtProvider.GetBitmap(wx.ART_GO_BACK))
        boxsizer3.Add((0, 0), 1) #spacer
        boxsizer3.Add(self.AddBtn, 0, 0, 0) #default values
        boxsizer3.Add((0, 0), 1)
        boxsizer3.Add(self.RemoveBtn)
        boxsizer3.Add((0, 0), 1)

        staticboxsizer1 = wx.StaticBoxSizer(wx.StaticBox(self, label="Subscribed Groups"), wx.HORIZONTAL)
        staticboxsizer1.Add(boxsizer3, 0, wx.EXPAND, 0)
        staticboxsizer1.Add(boxsizer2, 1, wx.LEFT|wx.EXPAND, 4)

        staticboxsizer2 = wx.StaticBoxSizer(wx.StaticBox(self, label="Server"), wx.HORIZONTAL)
        self.GetNGBtn = wx.Button(self, label="Get Newsgroups List")
        ServerST = wx.StaticText(self, label="news.gmane.org | 119")
        staticboxsizer2.Add(self.GetNGBtn)
        staticboxsizer2.Add(ServerST, 1, wx.LEFT|wx.ALIGN_CENTRE_VERTICAL, 4)

        staticboxsizer3 = wx.StaticBoxSizer(wx.StaticBox(self, label="Articles Number"), wx.HORIZONTAL)
        self.NumOfArticlesSC = wx.SpinCtrl(self)
        staticboxsizer3.Add(self.NumOfArticlesSC)
        
        boxsizer4 = wx.BoxSizer(wx.HORIZONTAL)
        boxsizer4.Add(staticboxsizer2, 1, wx.RIGHT|wx.EXPAND, 2)
        boxsizer4.Add(staticboxsizer3, 0, wx.EXPAND, 0)

        boxsizer5 = wx.BoxSizer(wx.VERTICAL)
        boxsizer5.Add(boxsizer4, 0, wx.EXPAND, 0)
        boxsizer5.Add(staticboxsizer1, 1, wx.EXPAND, 0)

        boxsizer6 = wx.BoxSizer(wx.HORIZONTAL)
        self.GroupTC = wx.TextCtrl(self)
        self.GroupTC.SetMinSize((150, -1))
        self.SearchBtn = wx.Button(self, label="Seach Group")
        boxsizer6.Add(self.GroupTC, 0, wx.RIGHT|wx.ALIGN_CENTRE_VERTICAL, 4)
        boxsizer6.Add(self.SearchBtn)
        
        self.LiveCB = wx.CheckBox(self, label="Perform Live Search")
        self.RegexCB = wx.CheckBox(self, label="Use Regular Expression")
        self.ShowFullBtn = wx.Button(self, label="Show Full List")
        self.NewsgroupsLC = wx.ListCtrl(self, style=wx.LC_REPORT)
        
        staticboxsizer4 = wx.StaticBoxSizer(wx.StaticBox(self, label="List"), wx.VERTICAL)
        staticboxsizer4.Add(boxsizer6)
        staticboxsizer4.Add(self.LiveCB)
        staticboxsizer4.Add(self.RegexCB)
        staticboxsizer4.Add(self.ShowFullBtn, 0, wx.BOTTOM|wx.EXPAND, 4)
        staticboxsizer4.Add(self.NewsgroupsLC, 1, wx.EXPAND, 0)

        boxsizer7 = wx.BoxSizer(wx.HORIZONTAL)
        boxsizer7.Add(staticboxsizer4, 0, wx.ALL|wx.EXPAND, 4)
        boxsizer7.Add(boxsizer5, 1, wx.TOP|wx.BOTTOM|wx.RIGHT|wx.EXPAND, 4)

        boxsizer8 = wx.BoxSizer(wx.VERTICAL)
        self.ButtonOk = wx.Button(self, wx.ID_OK)
        boxsizer8.Add(boxsizer7, 1, wx.EXPAND, 0)
        boxsizer8.Add(self.ButtonOk, 0, wx.EXPAND, 0)

        mainsizer = boxsizer8
        self.SetSizer(mainsizer)
        #self.SetSizerAndFit(mainsizer)

        self.GroupTC.SetFocus()
        self.SetMinSize((615, 270))
        self.SetSize((615, 420))
        self.Center()

app = wx.App(0)
w = GroupsListDlg()
w.ShowModal()
w.Destroy()
app.MainLoop()

#end

···

On Fri, 29 Sep 2006 11:14:03 -0700, Robin Dunn <robin@alldunn.com> wrote:

=============
#Robins XRC Code:
#NGSubscribe.xrc

<?xml version="1.0" encoding="utf-8"?>
<resource>
  <object class="wxPanel" name="NGSubscribePanel">
    <object class="wxBoxSizer">
      <orient>wxVERTICAL</orient>
      <object class="sizeritem">
        <object class="wxBoxSizer">
          <orient>wxHORIZONTAL</orient>
          <object class="sizeritem">
            <object class="wxStaticBoxSizer">
              <label>List</label>
              <orient>wxVERTICAL</orient>
              <object class="sizeritem">
                <object class="wxBoxSizer">
                  <orient>wxHORIZONTAL</orient>
                  <object class="sizeritem">
                    <object class="wxTextCtrl" name="GroupTC"/>
                    <flag>wxRIGHT|wxALIGN_CENTRE_VERTICAL</flag>
                    <border>4</border>
                    <minsize>150, -1</minsize>
                  </object>
                  <object class="sizeritem">
                    <object class="wxButton" name="SearchBtn">
                      <label>Seach Group</label>
                    </object>
                  </object>
                </object>
              </object>
              <object class="sizeritem">
                <object class="wxCheckBox" name="LiveCB">
                  <label>Perform Live Search</label>
                </object>
              </object>
              <object class="sizeritem">
                <object class="wxCheckBox" name="RegexCB">
                  <label>Use Regular Expression</label>
                </object>
              </object>
              <object class="sizeritem">
                <object class="wxButton" name="ShowFullBtn">
                  <label>Show Full List</label>
                </object>
                <flag>wxBOTTOM|wxEXPAND</flag>
                <border>4</border>
              </object>
              <object class="sizeritem">
                <object class="wxListCtrl" name="NewsgroupsLC">
                  <style>wxLC_REPORT</style>
                </object>
                <option>1</option>
                <flag>wxEXPAND</flag>
              </object>
            </object>
            <flag>wxALL|wxEXPAND</flag>
            <border>4</border>
          </object>
          <object class="sizeritem">
            <object class="wxBoxSizer">
              <orient>wxVERTICAL</orient>
              <object class="sizeritem">
                <object class="wxBoxSizer">
                  <orient>wxHORIZONTAL</orient>
                  <object class="sizeritem">
                    <object class="wxStaticBoxSizer">
                      <label>Server</label>
                      <orient>wxHORIZONTAL</orient>
                      <object class="sizeritem">
                        <object class="wxButton" name="GetNGBtn">
                          <label>Get Newsgroups List</label>
                        </object>
                      </object>
                      <object class="sizeritem">
                        <object class="wxStaticText" name="ServerST">
                          <label>news.gmane.org | 119</label>
                        </object>
                        <option>1</option>
                        <flag>wxLEFT|wxALIGN_CENTRE_VERTICAL</flag>
                        <border>4</border>
                      </object>
                    </object>
                    <option>1</option>
                    <flag>wxRIGHT|wxEXPAND</flag>
                    <border>2</border>
                  </object>
                  <object class="sizeritem">
                    <object class="wxStaticBoxSizer">
                      <label>Articles Number</label>
                      <orient>wxHORIZONTAL</orient>
                      <object class="sizeritem">
                        <object class="wxSpinCtrl" name="NumOfArticlesSC"/>
                      </object>
                    </object>
                    <flag>wxEXPAND</flag>
                  </object>
                </object>
                <flag>wxEXPAND</flag>
              </object>
              <object class="sizeritem">
                <object class="wxStaticBoxSizer">
                  <label>Subscribed Groups</label>
                  <orient>wxHORIZONTAL</orient>
                  <object class="sizeritem">
                    <object class="wxBoxSizer">
                      <orient>wxVERTICAL</orient>
                      <object class="spacer">
                        <size>0,0</size>
                        <option>1</option>
                      </object>
                      <object class="sizeritem">
                        <object class="wxBitmapButton" name="AddBtn">
                          <bitmap stock_id="wxART_GO_FORWARD"></bitmap>
                        </object>
                      </object>
                      <object class="spacer">
                        <size>0,0</size>
                        <option>1</option>
                      </object>
                      <object class="sizeritem">
                        <object class="wxBitmapButton" name="RemoveBtn">
                          <bitmap stock_id="wxART_GO_BACK"></bitmap>
                        </object>
                      </object>
                      <object class="spacer">
                        <size>0,0</size>
                        <option>1</option>
                      </object>
                    </object>
                    <flag>wxEXPAND</flag>
                  </object>
                  <object class="sizeritem">
                    <object class="wxBoxSizer">
                      <orient>wxVERTICAL</orient>
                      <object class="sizeritem">
                        <object class="wxListCtrl" name="SubscribedGroupsLC">
                          <style>wxLC_REPORT</style>
                        </object>
                        <option>1</option>
                        <flag>wxEXPAND</flag>
                      </object>
                      <object class="sizeritem">
                        <object class="wxBoxSizer">
                          <orient>wxHORIZONTAL</orient>
                          <object class="sizeritem">
                            <object class="wxTextCtrl" name="SubscribeManualTC"/>
                            <option>1</option>
                            <flag>wxALIGN_CENTRE_VERTICAL</flag>
                          </object>
                          <object class="sizeritem">
                            <object class="wxButton" name="SubscribeManualBtn">
                              <label>Subscribe Manually</label>
                            </object>
                            <flag>wxLEFT</flag>
                            <border>4</border>
                          </object>
                        </object>
                        <flag>wxTOP|wxEXPAND</flag>
                        <border>4</border>
                      </object>
                    </object>
                    <option>1</option>
                    <flag>wxLEFT|wxEXPAND</flag>
                    <border>4</border>
                  </object>
                </object>
                <option>1</option>
                <flag>wxEXPAND</flag>
              </object>
            </object>
            <option>1</option>
            <flag>wxTOP|wxBOTTOM|wxRIGHT|wxEXPAND</flag>
            <border>4</border>
          </object>
        </object>
        <option>1</option>
        <flag>wxEXPAND</flag>
      </object>
      <object class="sizeritem">
        <object class="wxButton" name="wxID_OK">
          <label></label>
        </object>
        <flag>wxEXPAND</flag>
      </object>
    </object>
  </object>
</resource>

--
Franz Steinhaeusler

Franz Steinhäusler wrote:

···

On Fri, 29 Sep 2006 11:14:03 -0700, Robin Dunn <robin@alldunn.com> wrote:

For a fun little wake-up-the-brain activity, I whipped it out in XRC for you.

WOW, thank you VERY much!

Did it take a long time?

About 20 minutes or so.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

Franz Steinhäusler wrote:

For a fun little wake-up-the-brain activity, I whipped it out in XRC for
you.

WOW, thank you VERY much!

Did it take a long time?

About 20 minutes or so.

Wow, you are a XRC Wizard! :slight_smile:

···

On Fri, 29 Sep 2006 11:14:03 -0700, Robin Dunn <robin@alldunn.com> wrote:

--
Franz Steinhaeusler

Hello

I search an auto Completion Combo Box.
When i type something in the textfield (from the Combo box) it should show me a list from posibilities which I can choose (from the Combobox list).

Exist anything like this?

Thx Micha

StyledTextCtrl suports this feature.

···

On 10/1/06, Micha Reiser <micha.reiser@famreiser.ath.cx> wrote:

Hello

I search an auto Completion Combo Box.
When i type something in the textfield (from the Combo box) it should
show me a list from posibilities which I can choose (from the Combobox
list).

Exist anything like this?

Thx Micha

--
I like python!
UliPad <<The Python Editor>>: UliPad - Woodpecker Wiki for CPUG
My Blog: http://www.donews.net/limodou