#include "FiveWin.ch"
static oWnd
static lEnd := .f., nArea
//----------------------------------------------------------------------------//
function Main()
nArea := 0
DEFINE WINDOW oWnd TITLE "Dialogo NoWait"
@ 2, 2 BUTTON "&Start" SIZE 80, 20 ACTION StartTest()
@ 2, 20 BUTTON "&Info" SIZE 80, 20 ACTION MsgInfo(select())
@ 2, 40 BUTTON "&Close Area" SIZE 80, 20 ACTION dbclosearea(select()) // Esto es para que de error al querer volver a ese dialogo nowait
ACTIVATE WINDOW oWnd MAXIMIZED
return nil
//----------------------------------------------------------------------------//
function StartTest()
local oDlg
local oBrw , n
nArea ++
n := nArea
USE Customer ALIAS "customer"+ALLTRIM(STR(nArea)) SHARED NEW
INDEX ON Field->State TO State
SET ORDER TO "State"
DEFINE DIALOG oDlg TITLE "No Wait Customer"+ALLTRIM(STR(nArea)) FROM 10, 10 TO 23, 70 RESIZABLE
@ 01,01 XBROWSE oBrw OF oDlg ;
LINES STYLE FLAT NOBORDER ;
COLUMNS "State","City", "Last", "First" ;
HEADERS "State","City", "Last", "First" PIXEL SIZE 200,70
oBrw:nMarqueeStyle = MARQSTYLE_HIGHLROW
oBrw:CreateFromCode()
oBrw:bGotFocus := {|| dbselectarea(oBrw:cAlias)}
ACTIVATE DIALOG oDlg NOWAIT VALID(Cerrar(n))
SysRefresh()
return nil
STATIC FUNCTION Cerrar(n)
dbclosearea( "customer"+ALLTRIM(STR(nArea)))
RETURN .t.
//----------------------------------------------------------------------------//
Silvio.Falconi wrote:
I open dbf with tdatabase why make error ?
is it possible to use a dialog in source (and not in resource) using the NOWAIT clause?
Meaning what
DEFINE DIALOG oDlg SIZE nWd, nHt PIXEL TRUEPIXEL;
FONT oFont COLOR CLR_BLACK, DLG_nColorDlg
ACTIVATE DIALOG oDlg NOWAIT
RETURN (NIL)
ACTIVATE DIALOG oDlg
oDbf:Close()
return nil
ACTIVATE DIALOG oDlg NOWAIT
oDbf:Close()
return nil
ACTIVATE DIALOG oDlg NOWAIT ;
VALID ( oDbf:Close(), .T. )
return nil
nageswaragunupudi wrote:Silvio.Falconi wrote:
WRONG
- Code: Select all Expand view
ACTIVATE DIALOG oDlg NOWAIT
oDbf:Close()
return nil
CORRECT WAY
- Code: Select all Expand view
ACTIVATE DIALOG oDlg NOWAIT ;
VALID ( oDbf:Close(), .T. )
return nil
nageswaragunupudi wrote:Silvio.Falconi wrote:
CORRECT WAY
- Code: Select all Expand view
ACTIVATE DIALOG oDlg NOWAIT ;
VALID ( oDbf:Close(), .T. )
return nil
ACTIVATE DIALOG oDlg NOWAIT ;
VALID ( oDbf:Close(), .T. )
oBrw:bRClicked := {|nRow,nCol| MenuContextual(nRow,nCol,oDlg,oBrw,oArticoli) }
Function MenuContextual(nRow,nCol,oDlg,oBrw,oDbf )
local oMenu
MENU oMenu POPUP 2015
MENUITEM "al primo record " +space(6)+ CHR(VK_TAB) + "Ctrl+Home";
MESSAGE "Mostra la lista dal primo record";
RESOURCE "GRID_TOP";
ACTION oBrw:KeyDown(VK_HOME, 0) WHEN oDbf:OrdKeyCount() > 0
MENUITEM "a pagina prec. " +space(6)+ CHR(VK_TAB) + "Pag. Sù";
MESSAGE "Mostra la lista della pagina precedente";
RESOURCE "GRID_PREVIOUS";
ACTION oBrw:KeyDown(VK_PRIOR, 0) WHEN oDbf:OrdKeyCount() > 0
MENUITEM "al precedente record " +space(6)+ CHR(VK_TAB) + "Indietro";
MESSAGE "Mostra la lista muovendosi al record precedente ";
RESOURCE "GRID_UP";
ACTION oBrw:KeyDown(VK_UP, 0) WHEN oDbf:OrdKeyCount() > 0
MENUITEM "avanti di un record " + CHR(VK_TAB) +space(6)+ "Avanti";
MESSAGE "Mostra la lista muovendosi al record avanti";
RESOURCE "GRID_DOWN";
ACTION oBrw:KeyDown(VK_DOWN, 0) WHEN oDbf:OrdKeyCount() > 0
MENUITEM "a pag. avanti " +space(6)+ CHR(VK_TAB) + "Pag. Giù";
MESSAGE "Mostra la lista della pagina avanti";
RESOURCE "GRID_NEXT";
ACTION oBrw:KeyDown(VK_NEXT, 0) WHEN oDbf:OrdKeyCount() > 0
MENUITEM "all'ultimo record " +space(6)+ CHR(VK_TAB) + "Ctrl+End";
MESSAGE "Mostra la lista all'ultimo record";
RESOURCE "GRID_BOTTOM";
ACTION oBrw:KeyDown(VK_END, 0) WHEN oDbf:OrdKeyCount() > 0
ENDMENU
ACTIVATE POPUP oMenu OF oDlg AT oBrw:nTop+nRow, oBrw:nLeft+nCol
return oMenu
Antonio Linares wrote:So glad to see you here with us Dear Rao
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 59 guests