Dialog/Window merge

Post Reply
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Dialog/Window merge

Post 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.
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post 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
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post 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
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Window & dialog

Post 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
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

TSBrowse in a window

Post 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
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post 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
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Test

Post 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
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post 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
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Browse

Post 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.
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
Post Reply