FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Dialog/Window merge
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Dialog/Window merge
Posted: 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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Dialog/Window merge
Posted: 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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Dialog/Window merge
Posted: Thu Dec 27, 2007 11:42 PM
Tim,

TSBrowse works on a window for me.

James

#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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Window & dialog
Posted: 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
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
TSBrowse in a window
Posted: Fri Dec 28, 2007 01: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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Dialog/Window merge
Posted: Fri Dec 28, 2007 01: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Test
Posted: Fri Dec 28, 2007 03: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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Dialog/Window merge
Posted: Fri Dec 28, 2007 04: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Browse
Posted: Fri Dec 28, 2007 04: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

Continue the discussion