Page 1 of 1

Dialog/Window merge

Posted: Thu Dec 27, 2007 10:53 pm
by TimStone
OK ... here is probably a basic question but I'm suffering a very stuffy head today ...

I have some controls that work OK in a window but not a dialog. I have some controls that work OK in a dialog, but not a window. I need to use both concurrently.

This is a non-MDI application !

I tried opening the window and dialog together. A button bar (OK on either ) and calendar control (which won't work on a dialog ) exist on the window. Thats no problem. Now I want to also use the dialog. It contains edit fields, buttons, and a TSBrowse ( which doesn't want to work on a window. The problem is getting the dialog into a decent position. I also need to then be able to click on window or dialog objects at any time.

I tried:

DEFINE WINDOW ...
DEFINE DIALOG ...

ACTIVATE DIALOG NOWAIT
ACTIVATE WINDOW

It shows, but no matter what I do, I'm not successful getting the dialog to get into a position other then the upper left corner which overshadows the window controls.

So, anyone have some sample code that shows bringing up a dialog in a window, and using it cleanly, with repositioning ?

Thanks.

Posted: Thu Dec 27, 2007 11:39 pm
by James Bott
Tim,

I'm not clear. Are you trying to display controls on a window and also a dialog on the same window? Are you using a splitter? If not, why not?

Can you provide a small sample showing what you are trying to do? Or maybe at least a screenshot?

James

Posted: Thu Dec 27, 2007 11:42 pm
by James Bott
Tim,

TSBrowse works on a window for me.

James

Code: Select all

#include "fivewin.ch"
#include "tsbrowse.ch"

function main()
   local oWnd, oLbx, oCustomer

   oCustomer:= TData():new(,"customer")
   oCustomer:use()

   define window oWnd

   @0,0 browse oLbx

   add column to oLbx header "First" data oCustomer:first
   add column to oLbx header "Last" data oCustomer:last

   oLbx:bSkip := { | nRecs | oCustomer:skipper( nRecs ) }

   oWnd:oClient:= oLbx

   activate window oWnd

return nil

Window & dialog

Posted: Fri Dec 28, 2007 12:42 am
by TimStone
I'll have to take another run at it shortly with TSBrowse. I tried blocking all of the code except for a couple of items, and then starting a window with one control, and trying to add TSBrowse ... but it would only show me a plain white box ( small ).

I think I'll start building up from the empty basic window instead of commenting out several hundred lines of code ... maybe that will help me resolve this ...

Tim

TSBrowse in a window

Posted: Fri Dec 28, 2007 1:15 am
by TimStone
No matter what I set @ x, y to, it always starts the browse at 0,0 and no matter what SIZE I enter, it takes the full window ... so no other controls will display ...

Tim

Posted: Fri Dec 28, 2007 1:24 am
by James Bott
Tim,

>No matter what I set @ x, y to, it always starts the browse at 0,0 and no matter what SIZE I enter, it takes the full window ... so no other controls will display ...

We need to see the code.

James

Test

Posted: Fri Dec 28, 2007 3:58 am
by TimStone
It starts at 0,0 and fills the whole screen ...

#include "FiveWin.ch"
#INCLUDE "tsbrowse.CH"

FUNCTION Main

LOCAL oWndc, oInv, oLbx

oInv := TData():new(, "c:\asw8s\einmst")
oInv:use( )

DEFINE WINDOW oWndc TITLE "Example"

@ 10, 10 BROWSE oLbx SIZE 300, 100 PIXEL
add column to oLbx header "One" data oInv:invnum
add column to oLbx header "Two" data oInv:invdes

oLbx:bSkip := { |nRecs| oInv:skipper( nRecs )}
oWndc:oClient := oLbx

ACTIVATE WINDOW oWndc MAXIMIZED

RETURN nil

Posted: Fri Dec 28, 2007 4:02 am
by James Bott
Tim,

This line tells it to fill the whole screen:

oWndc:oClient := oLbx

Leave it out if you don't want it to.

James

Browse

Posted: Fri Dec 28, 2007 4:01 pm
by TimStone
Apparently I have other issues in that .prg ... so I'm working on trying it from scratch ... and cut/paste from the other file ... seems to be OK so far.