#include "FiveWin.ch"
function Main()
SetKey( VK_F2, { || WhereAmI() } )
Another()
return nil
function Another()
local oDlg, cTest := Space( 20 )
DEFINE DIALOG oDlg TITLE "Test"
@ 1.5, 5 GET cTest
@ 3, 10 BUTTON "Ok"
ACTIVATE DIALOG oDlg CENTERED
return nil
function WhereAmI()
local oCtrl := oWndFromHwnd( GetFocus() )
MsgInfo( "ProcName: " + ProcName( 11 ) + CRLF + ;
"ProcLine: " + Str( ProcLine( 11 ) ) + CRLF + ;
"Focused object: " + oCtrl:ClassName() + CRLF + ;
"Dialog title: " + oCtrl:oWnd:GetText() )
return nil
Otto wrote:Hello Marc,
Maybe this is of some help to you. If you insert this into your program and SetKey( VK_F2, { || WhereAmI() } ) into the main function, then you can press F2 inside a function, and you get a info box to see where you are in your program.
Best regards,
Otto
- Code: Select all Expand view
#include "FiveWin.ch"
function Main()
SetKey( VK_F2, { || WhereAmI() } )
Another()
return nil
function Another()
local oDlg, cTest := Space( 20 )
DEFINE DIALOG oDlg TITLE "Test"
@ 1.5, 5 GET cTest
@ 3, 10 BUTTON "Ok"
ACTIVATE DIALOG oDlg CENTERED
return nil
function WhereAmI()
local oCtrl := oWndFromHwnd( GetFocus() )
MsgInfo( "ProcName: " + ProcName( 11 ) + CRLF + ;
"ProcLine: " + Str( ProcLine( 11 ) ) + CRLF + ;
"Focused object: " + oCtrl:ClassName() + CRLF + ;
"Dialog title: " + oCtrl:oWnd:GetText() )
return nil
Otto wrote:Marc,
you can insert a
TRY CATCH.
Best regards,
Otto
Otto wrote:Marc, Are you happy with the speed on your local PC. If so, then everything fits, because with RDP you have exactly this speed.
Best regards,
Otto
#include "fivewin.ch"
// EXECUTE IN FWH\SAMPLES FOLDER
REQUEST DBFCDX
static nSecs := 0
static nDelay := 1 // seconds
static oTimer
//----------------------------------------------------------------------------//
function Main()
field STATE,CODE
local oDlg, oStates, oCust
// OPEN DBF AND SET SCOPES
USE STATES NEW VIA "DBFCDX"
USE CUSTOMER NEW VIA "DBFCDX"
INDEX ON STATE TAG STATEM TO TMP MEMORY
SET ORDER TO TAG STATEM
GO TOP
SELECT STATES
SET RELATION TO CODE INTO CUSTOMER SCOPED
GO TOP
//
DEFINE DIALOG oDlg SIZE 900,600 PIXEL TRUEPIXEL
@ 20,20 XBROWSE oStates SIZE 250,-20 PIXEL OF oDlg ;
DATASOURCE "STATES" AUTOCOLS ;
CELL LINES NOBORDER
WITH OBJECT oStates
:bChange := { || nSecs := SECONDS() }
:CreateFromCode()
END
@ 20,250 XBROWSE oCust SIZE -20,-20 PIXEL OF oDlg ;
DATASOURCE "CUSTOMER" COLUMNS "STATE","CITY","SALARY" ;
CELL LINES NOBORDER
oCust:CreateFromCode()
ACTIVATE DIALOG oDlg ON INIT DlgInit( oDlg, oCust )
CLOSE DATA
return nil
//----------------------------------------------------------------------------//
static function DlgInit( oDlg, oCust )
DEFINE TIMER oTimer INTERVAL 1000 OF oDlg ACTION CustScope( oCust )
oTimer:Activate()
return nil
//----------------------------------------------------------------------------//
static function CustScope( oCust )
if nSecs > 0
if SECONDS() - nSecs >= nDelay
oCust:GoTop()
oCust:Refresh()
nSecs := 0
endif
endif
return nil
//----------------------------------------------------------------------------//
Marc Venken wrote:Can we trace or see somewhere witch functions have been called since hitting a button or startup...
Ex. Before I see my startup screen, 10's of functions have been called. Can we see it somewhere ?
I would be easy than to see if called functions have to be updated.
// 05 Facturen
Public aVelden5:= { ;
{ "Factuur" , "Factuur" , NIL, 50 }, ; // 1
{ "Klantnum" , "Klant" , NIL, 50 }, ; // 1
{ "Datum" , "Datum" , NIL, 60 }, ; //
{ "vervaldat" , "Verval" , NIL, 60 }, ; // 1
{ "basis" , "Basis" , NIL, 70 }, ; // 1
{ "btw" , "Btw" , NIL, 70 }, ; // 1
{ "Totaal" , "Totaal" , NIL, 70 }, ; // 1
{ "margesom" , "M_Som" , NIL, 70 }, ; // 1
{ "marge" , "M_Per" , NIL, 70 }} // 1
@ 0,0 XBROWSE oBrw[5] size -1,200 PIXEL OF oFld:aDialogs[ 4 ] font oFonts ;
DATASOURCE "facturen" ;
COLUMNS aVelden5;
AUTOSORT CELL LINES NOBORDER FOOTERS
WITH OBJECT oBrw[5]
:nColDividerStyle := LINESTYLE_LIGHTGRAY
:nRowDividerStyle := LINESTYLE_LIGHTGRAY
:bClrRowFocus := { || { CLR_BLACK, RGB(185,220,255) } }
:nMarqueeStyle := MARQSTYLE_HIGHLROWMS
:aCols[1]:cSortOrder = "facturen"
:aCols[1]:bLClickHeader:= {|| oBrw[5]:gotop(),oBrw[5]:refresh() }
:aCols[02]:cSortOrder = "factkl"
:aCols[02]:bLClickHeader:= {|| oBrw[5]:gotop(),oBrw[5]:refresh() }
:lFooter := .t.
:bRecSelHeader := { || "RowNo" }
:bRecSelData := { |o| o:KeyNo }
:bRecSelFooter := { |o| o:nLen }
:oRecSelFont := oFont // optional
:nRecSelWidth := "999" // required size
:basis:nFooterType := AGGR_SUM
:totaal:nFooterType := AGGR_SUM
:M_Som:nFooterType := AGGR_SUM
:MakeTotals()
:bgotfocus := { || oBrw[5]:maketotals(),set_factdet()}
END
oBrw[5]:SetChecks()
oBrw[5]:nHeadStrAligns := AL_CENTER
oBrw[5]:bChange := { |oBrw, uOlddata | set_factdet() }
oBrw[5]:bRClicked := { || XbrShowSizes( oBrw[5] ) }
oBrw[5]:nStretchCol := STRETCHCOL_WIDEST
oBrw[5]:CreateFromCode()
//Facturen historiek TWEEDE BROWSE
filter("hist","histfac",str(facturen->factuur))
Public aVelden6:= { ;
{ "levbon" , "Levbon" , NIL, 50 }, ; // 1
{ "artikel" , "Artikel" , NIL, 80 }, ; // 1
{ "Benaming" , "Benaming" , NIL, 200 }, ; // 1
{ "Aantal" , "Aantal" , NIL, 60 }, ; //
{ "eenh_prijs" , "Prijs" , NIL, 60 }, ; // 1
{ "korting" , "Kor" , NIL, 35 }, ; // 1
{ "aantal*(eenh_prijs - ( (eenh_prijs * korting) / 100))" , "Totaal" , NIL, 60 }, ; // 1
{ "margesom" , "M_Som" , NIL, 60 }, ; // 1
{ "marge" , "M_Per" , NIL, 60 }} // 1
@ 210,0 XBROWSE oBrw[6] size -1,-1 PIXEL OF oFld:aDialogs[ 4 ] font oFontS ;
DATASOURCE "hist" ;
COLUMNS aVelden6;
AUTOSORT CELL LINES NOBORDER FOOTERS
WITH OBJECT oBrw[6]
:nColDividerStyle := LINESTYLE_LIGHTGRAY
:nRowDividerStyle := LINESTYLE_LIGHTGRAY
:bClrRowFocus := { || { CLR_BLACK, RGB(185,220,255) } }
:nMarqueeStyle := MARQSTYLE_HIGHLROWMS
//oBrw[6]:bChange := { || oBrw[6]:MakeTotals() }
END
oBrw[6]:SetChecks()
oBrw[6]:nHeadStrAligns := AL_CENTER
oBrw[6]:bRClicked := { || XbrShowSizes( oBrw[6] ) }
oBrw[6]:nStretchCol := STRETCHCOL_WIDEST
for each cCol in { "Totaal", "M_Som" }
WITH OBJECT oBrw[6]:oCol( cCol )
:nFooterType := AGGR_SUM
END
next
oBrw[6]:MakeTotals()
oBrw[6]:CreateFromCode()
// Einde van Folders =================================================
James Bott wrote:Marc,
Are you using filters or scopes?
Are you doing incremental searches on a Get as the user types?
Are you trying to update five browses for each keystroke the user types into a search field?
Many things we did when the exe and databases were on the same computer are not practible on a network.
function filter(cAlias,cTag,cStart)
local cOld_alias:=Alias(), NTag:= &cOld_alias->(indexord())
default cStart:=""
dbfsopen() // IS ONLY HERE TO SEE HOW MANY TIMES IT IS PROCESSED (debugging Xbrowser)
select &cAlias
set order to tag &cTag
if !empty(cTag)
set scope to alltrim(cStart)
endif
&cAlias->(dbgotop())
select &cOld_alias
&cOld_alias->(dbsetorder(nTag))
return NIL
STATIC FUNCTION SET_SCOPE_3(oBrw3)
LOCAL cNName := alltrim(nofoto->Reflev)
DBSELECTAREA( "master" )
("master")->( ORDSCOPE(0, cNName ) )
("master")->(ORDSCOPE(1, cNName ) )
master->(dbgotop())
//oBrw3:Refresh()
RETURN NIL
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 103 guests