Split window question

forum.sourcecode (2000-2005) & forum.td.sourcecode (2005-2010)
Tom Heaverlo

Split window question

Post by Tom Heaverlo » 21 Feb 2006, 17:07

 Posted by:  Tom Heaverlo 

I'm not even sure if this is possible, but if it is, I would appreciate any
help that would point me in the right direction, or maybe a sample that
would help get me going.

Can a type of a split window be set up that would have an "explorer-type"
menu on the left pane, with the right pane occupied by series of form
windows, each of which would be activated when its menu item was clicked?

Is this possible to do in GTD? I've tried it with a splitter window, but
haven't had much success.

Thanks,

Tom

RainerE
Germany
Posts: 2204
Joined: 27 Apr 2021, 12:40
Location: Germany

Re: Split window question

Post by RainerE » 22 Feb 2006, 09:36

 Posted by:  Rainer Ebert 

Have you tried to add a form containing an invisible tab control on the
right pane of the splitter. The tab-form should contain one tab for each of
the different form windows with this form window assigned to the tab.

Rainer

Keith Sandberg

Re: Split window question

Post by Keith Sandberg » 22 Feb 2006, 22:15

 Posted by:  Keith Sandberg 

we did exactly this at my previous job. sorry but I don't have any source
code examples handy, I'll try to dig some up.

the app had (for example) a person's name, address, data. All discrete
objects were represented by a little graphical icon in a left-hand window.
Press on the address icon, and the person's address info would appear on the
right hand side. Click on the person's "info" icon, and the person's info
would appear. It was a very nice, user-friendly interface. It was a
pharmacy app, and the interface was called the "Patient Explorer".

i believe it was loosely based on the cSplitterWindow in the Visual
Toolchest samples, but I'm not sure.

Tom Heaverlo

Re: Split window question

Post by Tom Heaverlo » 22 Feb 2006, 22:28

 Posted by:  Tom Heaverlo 

I've been trying the Tab window thing, and everything looks fine until I try
to run the app. It appears (and I'm not sure if its me or a GTD2005.1
glitch) that when I drop a data field or combo box onto one of the tabs,
that object is being resized to match the size of the tab frame.

Keith... if you're lucky enough to run across a sample, I'd sure appreciate
it!

Thanks!

Tom

tk

Re: Split window question

Post by tk » 08 Mar 2006, 11:40

 Posted by:  tk 

Hi Tom,

try the following:
Use the "cQuickTabsForm" for the things you would show on the right: Tables,
Fields, etc. (you put them into FormWindows and one FormWindows on each
Tab - you know it).
For the "ControlerPane" (on the left) use the a dockable Dialog (in it you
can use a treeView-Column from M!Table as "explorerTree" for instance - to
show/create/swap the tabs).
You can generate the Tabs on the fly and with some little tricks place the
forms into it - or you can generate the Tabs with the forms at design time
and show/hide them at runtime - all is possible.
My application work so, it looks fine a it is stable.

thomas

Tom Heaverlo

Re: Split window question

Post by Tom Heaverlo » 08 Mar 2006, 17:46

 Posted by:  Tom Heaverlo 

Thank you for the pointers Thomas! I'll give your idea a try!

Tom

tk

Re: Split window question

Post by tk » 10 Mar 2006, 13:31

 Posted by:  tk 

Hi Tom,

to resize a table into a form or dialog, i catch the WM_Size in the form or
dlg in following manner:

On WM_Size

Call GetClientRect( hWndForm, c_nLeft, c_nTop, c_nRight, c_nBottom )

Call SalSendMsgToChildren( hWndForm, NCF_OnChangeSize, 0, 0 )

Now the ChildTblWindows can catch the sendet NCF_OnChangeSize to react
(change the size of the table, pos the buttons or fields, etc.).

In my ControlPanel, the user works with Click or DoubleClick, or with some
buttons, which are positioned on the top of the dialog (so I don't have to
repos them).

Also you can design the TreeColumns in the Table, so the user can't see, if
it is a table or a list (assuming you are using M!Table).

Another possibility is, to use a list box from classType "cOutlineListBox",
to build a treeView.

The tabs in the tabWindow repositions automatically with the size of the
form and so the forms in the tabs. If you have tables in the forms, they can
also catch the WM_Size (suggest you to build a class cfrmSizable and
ctblCanSize or so). And if you have fields in the form, it is possible to
reposition them.

For the handling between the Buttons(Commanders) and the Tables, Fields, ...
I use the observer pattern, which is very handy for conversation between one
controlerPanel and many Forms, Tabs, Dlgs, ... (some ideas to implement this
pattern in Centura you can get from the Centura-Homepage).

hoping this will help you a little

so long - thomas

Keith Sandberg

Re: Split window question

Post by Keith Sandberg » 13 Jul 2006, 21:25

 Posted by:  Keith Sandberg 

I finally had time to comb thru some old code. I had to remove all the
database-specific stuff and streamlined the code that keeps the listbox
items and data objects in sync. I also changed the application to be a
simple "Music library".

To address your specific problem with the splitter window, I came up with a
"work-around" by creating my own TabForm/Splitter window class (see the
attached KMSSplitListTabs.apl). The Visual Toolkit Splitter window has an
annoying glitch -- it grabs the first two items it finds (using the Tab
Layout order) and expands those to fill in each Splitter pane.... which
works great with Tab Forms *IF* (and only IF) there are *no* other items on
the tab form. Once you place a button or datafield on the tab form, the
classes grab that item instead of the tab form (the tab form does NOT show
up in the Tab Order List, but its child windows do!). The way I got around
it is to create a tab form, and leave the first tab BLANK (kinda as a stub).

Anyway... test drive the app, I think it demonstrates exactly what you were
trying to do. It was written on TD 2.1, with several VT and QuickObjects
APL's. I would've included some MP3's but didn't want to get accused of
music piracy!

Keith

You do not have the required permissions to view the files attached to this post.

Keith Sandberg

Re: Split window question

Post by Keith Sandberg » 13 Jul 2006, 21:48

 Posted by:  Keith Sandberg 

It's GTD. The Splitter class looks for the first two objects in the
outline - it uses #1 to fill the left-hand pane, and #2 to fill the
right-hand pane. If you create a splitter window with a listbox on the
left, and a tabs form on the right, everything works great, UNTIL.....

You place a control on the tab window. For some reason, the cSplitter class
will see your new control (push button, data field, etc) as object #2, and
use that to fill the right-hand pane instead of the tabs form. It has
something to do with Tab Order - if you look, the tab window does NOT show
up on the tab order list, while any child controls do.

So, a "work around" is to create a combo splitter/tab form class, with a
only two objects - a list box on the left, and a BLANK tab form on the
right. In your app, use this new class... and make sure to never, ever,
ever put anything on Tab 0. Add new tabs instead.

Return to “td.sourcecode”

Who is online

Users browsing this forum: [Ccbot] and 1 guest