I've been trying different layouts using Gnoga, but have had trouble
actually getting things to display they way I want.  Is there a resource
that goes through exactly the order of operations to get each element to
display the way you want?  For example, I want to lay out a page with 3
rectangular areas.  One will be vertical with some buttons and other
elements.  One will be the main area and included a Tabbed view.  Another
will be the bottom "status" area.  I want everything to pack itself up and
left so that even if the user stretches the browser, the elements don't
stretch or move.  Below is some ascii art of what I am looking for:

|------|-------------------------------------------------|
| []   |_/====\/====\____________________________________|
|      | []                                              |
|      | []                                              |
|      | []                                              |
|      | []                                              |
|      | []                                              |
|      | []                                              |
|      | []                                              |
|------|-------------------------------------------------|
| []                                                     |
|--------------------------------------------------------|

You'll need to drop this into a fixed font editor to see it correctly, but
I hope that explains what I want.

When trying to lay this out in Gnoga, I am having trouble.  Elements stack
on top of each other.  My gut is telling me I am using the wrong element
types or doing something out of order.  I haven't located any references in
the documentation on how to understand this part.

Here are the pertinent code chunks to creating it.:

   type Components_List is record
      --Main Panels
      Main_View   : Gnoga.Gui.View.View_Type;
      Left_View   : aliased Gnoga.Gui.View.View_Type;
      Middle_View : aliased Gnoga.Gui.View.View_Type;
      Bottom_View : aliased Gnoga.Gui.View.View_Type;

      --Organization
      Docker1 : Gnoga.Gui.View.Docker.Docker_View_Type;
      Docker2_Panel : aliased Gnoga.Gui.View.View_Type;
      Docker2 : Gnoga.Gui.View.Docker.Docker_View_Type;

      -- Tabs
      Tab_Bar      : aliased Gnoga.Gui.View.Card.Tab_Type;
      Tab_Docker   : Gnoga.Gui.View.Docker.Docker_View_Type;
      Tab_Deck     : aliased Gnoga.Gui.View.Card.Card_View_Type;
      Tab_Panel    : aliased Gnoga.Gui.View.View_Type;

      --Components
      Button0 : Gnoga.Gui.Element.Common.Button_Type;
      Button1 : Gnoga.Gui.Element.Common.Button_Type;
      Button2 : Gnoga.Gui.Element.Common.Button_Type;
      Button3 : Gnoga.Gui.Element.Common.Button_Type;
      Button4 : Gnoga.Gui.Element.Common.Button_Type;
      Button5 : Gnoga.Gui.Element.Common.Button_Type;
      Button6 : Gnoga.Gui.Element.Common.Button_Type;
      Button7 : Gnoga.Gui.Element.Common.Button_Type;
      Button8 : Gnoga.Gui.Element.Common.Button_Type;
      Button9 : Gnoga.Gui.Element.Common.Button_Type;

   end record;

***

package body Test_Tabs_01 is
   procedure Create
       (Parent : in out Gnoga.Gui.Base.Base_Type'Class;
        Attach : in Boolean := True;
        ID : in String := "") is
   begin
      Components.Main_View.Create(Parent,Attach,ID);
      Components.Docker1.Create(Components.Main_View);
      Components.Docker2_Panel.Create(Components.Docker1);
      Components.Docker2.Create(Components.Docker2_Panel);
      Components.Bottom_View.Create(Components.Docker1);
      Components.Left_View.Create(Components.Docker2);
      Components.Middle_View.Create(Components.Docker2);


      Components.Tab_Docker.Create(Components.Middle_View);
      Components.Tab_Deck.Create(Components.Tab_Docker);
      Components.Tab_Bar.Create(Components.Tab_Docker,Components.Tab_Deck);
      Components.Tab_Panel.Create(Components.Tab_Deck);


      Components.Button0.Create(Components.Left_View,   "Button 0");

      Components.Button1.Create(Components.Tab_Panel, "Button 1");
      Components.Button2.Create(Components.Tab_Panel, "Button 2");
      Components.Button3.Create(Components.Tab_Panel, "Button 3");
      Components.Button4.Create(Components.Tab_Panel, "Button 4");
      Components.Button5.Create(Components.Tab_Panel, "Button 5");
      Components.Button6.Create(Components.Tab_Panel, "Button 6");
      Components.Button7.Create(Components.Tab_Panel, "Button 7");
      Components.Button8.Create(Components.Tab_Panel, "Button 8");


      Components.Button9.Create(Components.Bottom_View, "Button 9");

   end Create;

   procedure Initialize is
   begin

      Components.Tab_Deck.Add_Card(Name => "Main Tab",
                                   Card => Components.Tab_Panel'Access);
      Components.Tab_Bar.Add_Tab(Card     => "Main Tab",
                                 Label    => "Main Tab",
                                 Selected => True);
      Components.Tab_Docker.Fill_Dock(Components.Tab_Deck'Access);
      Components.Tab_Docker.Top_Dock(Components.Tab_Bar'Access);

      Components.Docker2.Fill_Dock(Components.Middle_View'Access);
      Components.Docker2.Left_Dock(Components.Left_View'Access);
      Components.Docker1.Fill_Dock(Components.Bottom_View'Access);
      Components.Docker1.Top_Dock(Components.Docker2_Panel'Access);


   end Initialize;

end Test_Tabs_01;

After this, I just call

Test_Tabs_01.Create;
Test_Tabs_01.Initialize;

within my main.

Button 9 shows up over top of Button 0 instead of the bottom view I was
trying to setup.  I don't want to setup the bottom view as a Bottom Dock
because browser window resizing moves it and I want to pack the view up and
left if possible.

In addition, buttons 1-8 show up offset from the tabs themselves.

I've tried reordering some of the calls but either nothing changes or I
still can't get exactly what I want.

Sorry about all the unnecessary aliased vars.  I was playing around with
different configs.  There are also some unnecessary views, but I am really
trying to figure out how to place things where I want, so I have been
trying everything I can think of.

Thanks!
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list

Reply via email to