Dialog/Window merge

Dialog/Window merge

Postby TimStone » Thu Dec 27, 2007 10:53 pm

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
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Postby James Bott » Thu Dec 27, 2007 11:39 pm

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: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby James Bott » Thu Dec 27, 2007 11:42 pm

Tim,

TSBrowse works on a window for me.

James

Code: Select all  Expand view  RUN
#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
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Window & dialog

Postby TimStone » Fri Dec 28, 2007 12:42 am

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
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

TSBrowse in a window

Postby TimStone » Fri Dec 28, 2007 1:15 am

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
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Postby James Bott » Fri Dec 28, 2007 1:24 am

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

Test

Postby TimStone » Fri Dec 28, 2007 3:58 am

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
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Postby James Bott » Fri Dec 28, 2007 4:02 am

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

Browse

Postby TimStone » Fri Dec 28, 2007 4:01 pm

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
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 54 guests