In this application I can drag the window from everywhere on the red zone.
Does someone know how to do this?
Thanks in advance
Otto
drag zone on window without title
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Otto,
Here you have a working sample:
Here you have a working sample:
Code: Select all
#include "FiveWin.ch"
function Main()
local oWnd, nRowPos, nColPos, lDrag := .F.
DEFINE WINDOW oWnd STYLE WS_POPUP COLOR "W/R"
oWnd:bLClicked := { | nRow, nCol | nRowPos := nRow, nColPos := nCol, lDrag := .T. }
oWnd:bMMoved = { | nRow, nCol | If( lDrag, oWnd:Move( oWnd:nTop + nRow - nRowPos,;
oWnd:nLeft + nCol - nColPos ),) }
oWnd:bLButtonUp := { || lDrag := .F. }
ACTIVATE WINDOW oWnd
return nil
Hello Antonio,
thank you for your help.
Could you please have another look.
I would need this for MDI windows.
The ECR prints to the screen and there can be many receipts at one time.
The cook can with a touch screen sort the receipts and click crossed out the meals he so far has prepared.
A timer watch the directory and brings up the receipt to the screen. First all the meal are announced with Playsound() – thanks to you it is working .
It would be nice if the zone to drag the receipts would be bigger than the title because you have to use your fingers.
#include "FiveWin.ch"
#include "InKey.ch"
#include "xbrowse.ch"
static oWnd
static nTop:=0
//----------------------------------------------------------------------------//
function Main()
local oBar
DEFINE WINDOW oWnd MDI ;
TITLE "Küchenmeister"
DEFINE BUTTONBAR oBar 3D OF oWnd
DEFINE BUTTON OF oBar ACTION CustomerBrowse()
// SET MESSAGE OF oWnd TO "FiveWin xBase power!" CENTERED
ACTIVATE WINDOW oWnd MAXIMIZED
return nil
//----------------------------------------------------------------------------//
function CustomerBrowse()
local oWndChild, oBrw
local cAlias
local nRowPos, nColPos, lDrag := .F.
USE Customer NEW ALIAS ( cAlias := GetNewAlias( "CUST" ) ) SHARED
DEFINE WINDOW oWnd ChildSTYLE MDICHILD TITLE Alias() // WS_POPUP COLOR "W/R"
oBrw := TXBrowse():New( oWndChild )
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:lColDividerComplete := .t.
oBrw:SetRDD()
oBrw:CreateFromCode()
// oWndChild:oClient := oBrw
oWndChild:bLClicked := { | nRow, nCol | nRowPos := nRow, nColPos := nCol, lDrag := .T. }
oWndChild:bMMoved = { | nRow, nCol | If( lDrag, oWndChild:Move( oWndChild:nTop + nRow - nRowPos,;
oWndChild:nLeft + nCol - nColPos ),) }
oWndChild:bLButtonUp := { || lDrag := .F. }
return nil
// oWndChild:Center()
ACTIVATE WINDOW oWndChild ON INIT (oWndChild:nLeft(320),oWndChild:nTop(nTop*20),oWndChild:nWidth(250), oBrw:SetFocus())
return nil
//----------------------------------------------------------------------------//
function GetNewAlias( cDbfName )
static n := 0
nTop:=n
return cDbfName + StrZero( ++n, 2 )
//----------------------------------------------------------------------------//
thank you for your help.
Could you please have another look.
I would need this for MDI windows.
The ECR prints to the screen and there can be many receipts at one time.
The cook can with a touch screen sort the receipts and click crossed out the meals he so far has prepared.
A timer watch the directory and brings up the receipt to the screen. First all the meal are announced with Playsound() – thanks to you it is working .
It would be nice if the zone to drag the receipts would be bigger than the title because you have to use your fingers.
#include "FiveWin.ch"
#include "InKey.ch"
#include "xbrowse.ch"
static oWnd
static nTop:=0
//----------------------------------------------------------------------------//
function Main()
local oBar
DEFINE WINDOW oWnd MDI ;
TITLE "Küchenmeister"
DEFINE BUTTONBAR oBar 3D OF oWnd
DEFINE BUTTON OF oBar ACTION CustomerBrowse()
// SET MESSAGE OF oWnd TO "FiveWin xBase power!" CENTERED
ACTIVATE WINDOW oWnd MAXIMIZED
return nil
//----------------------------------------------------------------------------//
function CustomerBrowse()
local oWndChild, oBrw
local cAlias
local nRowPos, nColPos, lDrag := .F.
USE Customer NEW ALIAS ( cAlias := GetNewAlias( "CUST" ) ) SHARED
DEFINE WINDOW oWnd ChildSTYLE MDICHILD TITLE Alias() // WS_POPUP COLOR "W/R"
oBrw := TXBrowse():New( oWndChild )
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:lColDividerComplete := .t.
oBrw:SetRDD()
oBrw:CreateFromCode()
// oWndChild:oClient := oBrw
oWndChild:bLClicked := { | nRow, nCol | nRowPos := nRow, nColPos := nCol, lDrag := .T. }
oWndChild:bMMoved = { | nRow, nCol | If( lDrag, oWndChild:Move( oWndChild:nTop + nRow - nRowPos,;
oWndChild:nLeft + nCol - nColPos ),) }
oWndChild:bLButtonUp := { || lDrag := .F. }
return nil
// oWndChild:Center()
ACTIVATE WINDOW oWndChild ON INIT (oWndChild:nLeft(320),oWndChild:nTop(nTop*20),oWndChild:nWidth(250), oBrw:SetFocus())
return nil
//----------------------------------------------------------------------------//
function GetNewAlias( cDbfName )
static n := 0
nTop:=n
return cDbfName + StrZero( ++n, 2 )
//----------------------------------------------------------------------------//
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Otto,
Here you have it:
Here you have it:
Code: Select all
#include "FiveWin.ch"
#include "InKey.ch"
#include "xbrowse.ch"
static nTop:=0
//----------------------------------------------------------------------------//
function Main()
local oWnd, oBar
DEFINE WINDOW oWnd MDI ;
TITLE "Küchenmeister"
DEFINE BUTTONBAR oBar 3D OF oWnd
DEFINE BUTTON OF oBar ACTION CustomerBrowse()
// SET MESSAGE OF oWnd TO "FiveWin xBase power!" CENTERED
ACTIVATE WINDOW oWnd MAXIMIZED
return nil
//----------------------------------------------------------------------------//
function CustomerBrowse()
local oWnd, oBrw
local cAlias
local nRowPos, nColPos, lDrag := .F.
USE Customer NEW ALIAS ( cAlias := GetNewAlias( "CUST" ) ) SHARED
DEFINE WINDOW oWnd MDICHILD TITLE Alias() // WS_POPUP COLOR "W/R"
oBrw := TXBrowse():New( oWnd )
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:lColDividerComplete := .t.
oBrw:SetRDD()
oBrw:CreateFromCode()
// oWndChild:oClient := oBrw
oWnd:bLClicked := { | nRow, nCol | nRowPos := nRow, nColPos := nCol, lDrag := .T. }
oWnd:bMMoved = { | nRow, nCol | If( lDrag, oWnd:Move( oWnd:nTop + nRow - nRowPos,;
oWnd:nLeft + nCol - nColPos,,, .T. ),) }
oWnd:bLButtonUp := { || lDrag := .F. }
ACTIVATE WINDOW oWnd ON INIT (oWnd:nLeft(320),oWnd:nTop(nTop*20),oWnd:nWidth(250), oBrw:SetFocus())
return nil
//----------------------------------------------------------------------------//
function GetNewAlias( cDbfName )
static n := 0
nTop:=n
return cDbfName + StrZero( ++n, 2 )
//----------------------------------------------------------------------------//
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: