Page 1 of 1
get -oSortCbx
Posted: Thu Oct 21, 2021 9:29 am
by Silvio.Falconi
I add a get to make e search and it run ok only when I resize the Mdichild the get is not focused
before
after ( when resize the mdichild and not move over any mouse or windows)

I use the sam esystem of yunus mdichild only I change the measure of buttonbar and I add a combobox and a get on buttonbar
Code: Select all | Expand
if oWndEsercizi == nil
oEsercizi:= TEsercizi():New()
DEFINE WINDOW oWndEsercizi MDICHILD OF oWndMain TITLE "Esercizi"
...
ACTIVATE WINDOW oWndEsercizi MAXIMIZED ;
ON INIT oGet:setfocus() ;
VALID ( oWndEsercizi := nil, .T. )
else
oWndEsercizi:SetFocus()
endif
any solution ?
I add also a resize but ir not work ok
Code: Select all | Expand
ACTIVATE WINDOW oWndEsercizi MAXIMIZED ;
ON INIT oGet:setfocus() ;
ON RESIZE oGet:setfocus() ;
VALID ( oWndEsercizi := nil, .T. )
else
Re: get -oSortCbx
Posted: Thu Oct 21, 2021 5:16 pm
by Antonio Linares
Dear Silvio,
Please try it this way:
oGet:PostMsg( WM_SETFOCUS )
Re: get -oSortCbx
Posted: Fri Oct 22, 2021 7:52 am
by Silvio.Falconi
Antonio Linares wrote:Dear Silvio,
Please try it this way:
oGet:PostMsg( WM_SETFOCUS )
I must insert it where ? on init ?
not run
this my sourceCode: Select all | Expand
static function Clienti()
local oBrw, cClrBack, cAlias
local oBar, oMsgBar, oMsgDeleted
local oIscritti
local cSeek:=space(100)
local oGet
if oWndIscritti == nil
oIscritti:=TClienti():New()
DEFINE WINDOW oWndIscritti MDICHILD OF oWndMain TITLE "Tabella Iscritti"
@ 10, 585 GET oGet VAR cSeek SIZE 280,24 PIXEL OF oBar
@ 2, 0 XBROWSE oBrw SIZE -20,-20 PIXEL OF oWndIscritti ;
DATASOURCE oIscritti ;
COLUMNS "CliCognome","CliNome","CliFiscale",;
"CliPartiva","CliIndiriz","CliPaese",;
"CliCap","CliProv", "CliRegione","CliTelef1",;
"CliTelef2","CliEmail","CliSitoWeb","CliAppunti";
HEADERS "Cognome","Nome","Codice Fiscale","Partita Iva",;
"Indirizzo","Località","Cap", "Provincia","Regione",;
"Cellulare","Telefono","Email","Sito Web","Appunti";
AUTOSORT ;
NOBORDER LINES
oBar := BrwBtnBar( @oBrw, oWndIscritti)
DEFINE BUTTON OF oBar PROMPT "ricerca" RESOURCE "view" ;
ACTION NIL
DEFINE BUTTON OF oBar PROMPT "Print" RESOURCE "report" ;
ACTION oBrw:Report( "Iscritti report",, .F.) LEFT
@ 10,460 COMBOBOX oBrw:oSortCbx VAR oBrw:cSortOrder SIZE 100,400;
PIXEL OF oBar
* DEFINE BUTTON OF oBar PROMPT "Close" RESOURCE "exit" ;
* ACTION oWndIscritti:End() LEFT
cAlias = Alias()
BrwColors( oBrw )
BrwRecSel( oBrw, "RECNO" )
WITH OBJECT oBrw
:l2007:=.f.
:nRecSelColor := nRgb( 245,244,234)
:bClrStd := { || { CLR_BLACK, If( oBrw:SelectRow(), 0x88EDFB, CLR_WHITE ) } }
:oSeek := oGet
:lIncrFilter := .t.
:SetMultiSelectCol()
:lDrawBorder := .t.
:l2015 := .T.
// :bEdit := { |oRec| EditEsercizi( oRec,oEsercizi ) }
:CreateFromCode()
END
oBrw:SetFocus()
// oBrw:bLDblClick = { || oBrw:EditSource(,, .T.) }
oWndIscritti:oClient = oBrw
oWndIscritti:oControl = oBrw
DEFINE MSGBAR oMsgBar OF oWndIscritti 2007
ACTIVATE WINDOW oWndIscritti ;
ON INIT oGet:setfocus() ;
ON RESIZE oGet:setfocus() ;
VALID ( oWndIscritti := nil, .T. )
else
oWndIscritti:SetFocus()
endif
return nil
Re: get -oSortCbx
Posted: Fri Oct 22, 2021 3:08 pm
by karinha
// \samples\tutor04.prg modificado.
Code: Select all | Expand
#include "FiveWin.ch"static oWnd
//----------------------------------------------------------------------------//function Main
() LOCAL oIco, oBar, oBmp
LOCAL cSeek :=
[FOCUS EN EL
GET DE SILVIO FALCONI...
TAN SIMPLES...
] LOCAL oGet
SkinButtons
() SetGetColorFocus
( CLR_GREEN
) DEFINE ICON oIco FILE
"..\icons\fax.ico" DEFINE WINDOW oWnd
FROM 1,
1 TO 22,
75 ;
TITLE "FiveWin sample" ;
MENU BuildMenu
() ;
COLOR "B/W" ;
ICON oIco
DEFINE BUTTONBAR oBar _3D
SIZE 26,
27 OF oWnd
// Set( 29, ! Set( 29 ) ) IF Set
( _SET_INSERT, ! Set
( _SET_INSERT
) ) Set
( _SET_INSERT, ! Set
( _SET_INSERT
) ) ENDIF @
10,
05 GET oGet
VAR cSeek
SIZE 280,
24 PIXEL OF oBar
oGet:
PostMsg( WM_SETFOCUS
) DEFINE BUTTON OF oBar FILENAME
"..\bitmaps\16x16\new.bmp" FLAT ;
ACTION MsgInfo( "New" ) ;
TOOLTIP
"Creates a new document" DEFINE BUTTON OF oBar FILENAME
"..\bitmaps\16x16\open.bmp" FLAT ;
ACTION MsgInfo( cGetFile
( "*.*",
"Select a document to open" ) ) ;
TOOLTIP
"Opens a document" WHEN .f.
DEFINE BUTTON OF oBar FILENAME
"..\bitmaps\16x16\floppy.bmp" FLAT ;
ACTION MsgInfo( Time
() ) TOOLTIP
"Saves this document" DEFINE BUTTON OF oBar FILENAME
"..\bitmaps\16x16\printer.bmp" FLAT ;
ACTION MsgInfo( "Prints this document" ) TOOLTIP
"Print this document" GROUP
DEFINE BUTTON OF oBar FILENAME
"..\bitmaps\16x16\prop.bmp" FLAT ;
ACTION PrinterSetup
() TOOLTIP
"Setup the printer" DEFINE BUTTON OF oBar FILENAME
"..\bitmaps\16x16\HelpInd.bmp" FLAT ;
ACTION MsgInfo( Version
() ) TOOLTIP
"A multiple lines" + ;
Chr
( 13 ) + Chr
( 10 ) +
"tooltip!" GROUP
DEFINE BUTTON OF oBar FILENAME
"..\bitmaps\16x16\Help.bmp" FLAT ;
ACTION MsgInfo( "fivewin power!" ) TOOLTIP
"fivewin power!" DEFINE BUTTON OF oBar FILENAME
"..\bitmaps\16x16\Exit.bmp" FLAT ;
ACTION oWnd:
End() TOOLTIP
"Exit this app" GROUP
/*
DEFINE MESSAGE OF oWnd ;
PROMPT " Skype: joao@pleno.com.br " + FWVERSION + " " + FWCOPYRIGHT + ;
NOINSET CENTERED KEYBOARD DATE CLOCK
*/ DEFINE BITMAP oBmp FILENAME
"..\bitmaps\fiveback.bmp" oWnd:
bPainted =
{ | hDC | BmpTiled
( hDC, oWnd, oBmp
) } ACTIVATE WINDOW oWnd ;
VALID MsgYesNo
( "Do you want to quit ?" ) // Set( 29, ! Set( 29 ) ) IF Set
( _SET_INSERT, ! Set
( _SET_INSERT
) ) Set
( _SET_INSERT, ! Set
( _SET_INSERT
) ) ENDIFreturn nil//----------------------------------------------------------------------------//function BuildMenu
() local oMenu
MENU oMenu
MENUITEM "Information" MENU MENUITEM "&About..." ;
ACTION MsgInfo( FWDESCRIPTION
) ;
FILENAME
"..\bitmaps\16x16\info.bmp" SEPARATOR MENUITEM "&End..." ;
ACTION oWnd:
End() FILENAME
"..\bitmaps\16x16\exit.bmp" ENDMENU MENUITEM "&Clients" MENU MENUITEM "&New..." ;
ACTION ( MsgStop
( "New Clients" ),;
oWnd:
Say( 5,
5,
"New Clients...",
"GR+/G" ) ) ;
FILENAME
"..\bitmaps\16x16\faces.bmp" MENUITEM "&Modify..." ACTION MsgInfo( "Modif. Clients" ) ;
FILENAME
"..\bitmaps\edit.bmp" MENUITEM "&Delete..." ACTION MsgAlert
( "Del Clients" ) ;
FILENAME
"..\bitmaps\16x16\delete.bmp" SEPARATOR MENUITEM "&Browse..." ACTION MsgInfo( "Browse Clients" ) ;
FILENAME
"..\bitmaps\16x16\browse.bmp" ENDMENU MENUITEM "&Utilities" MENU MENUITEM "&Calculator..." ACTION WinExec
( "Calc" ) ;
FILENAME
"..\bitmaps\16x16\calc.bmp" MENUITEM "&Internet..." ;
ACTION WinExec
( "start iexplore www.fivetech.com",
0 ) ;
FILENAME
"..\bitmaps\16x16\explorer.bmp" ENDMENU ENDMENUreturn oMenu
//----------------------------------------------------------------------------//STATIC FUNCTION BmpTiled
( hDC, oWnd, oBmp
) local nWidth := oWnd:
nWidth(), nHeight := oWnd:
nHeight() local nRow :=
0, nCol :=
0, n
local nBmpWidth := oBmp:
nWidth(), nBmpHeight := oBmp:
nHeight() if oBmp:
hBitmap ==
0 return nil endif while nRow < nHeight
nCol =
0 while nCol < nWidth
PalBmpDraw
( hDC, nRow, nCol, oBmp:
hBitmap ) nCol += nBmpWidth
end
nRow += nBmpHeight
end
return nil//----------------------------------------------------------------------------//
Re: get -oSortCbx
Posted: Fri Oct 22, 2021 7:07 pm
by Silvio.Falconi
karinha wrote:// \samples\tutor04.prg modificado.
Code: Select all | Expand
#include "FiveWin.ch"static oWnd
//----------------------------------------------------------------------------//function Main
() LOCAL oIco, oBar, oBmp
LOCAL cSeek :=
[FOCUS EN EL
GET DE SILVIO FALCONI...
TAN SIMPLES...
] LOCAL oGet
SkinButtons
() SetGetColorFocus
( CLR_GREEN
) DEFINE ICON oIco FILE
"..\icons\fax.ico" DEFINE WINDOW oWnd
FROM 1,
1 TO 22,
75 ;
TITLE "FiveWin sample" ;
MENU BuildMenu
() ;
COLOR "B/W" ;
ICON oIco
DEFINE BUTTONBAR oBar _3D
SIZE 26,
27 OF oWnd
// Set( 29, ! Set( 29 ) ) IF Set
( _SET_INSERT, ! Set
( _SET_INSERT
) ) Set
( _SET_INSERT, ! Set
( _SET_INSERT
) ) ENDIF @
10,
05 GET oGet
VAR cSeek
SIZE 280,
24 PIXEL OF oBar
oGet:
PostMsg( WM_SETFOCUS
) DEFINE BUTTON OF oBar FILENAME
"..\bitmaps\16x16\new.bmp" FLAT ;
ACTION MsgInfo( "New" ) ;
TOOLTIP
"Creates a new document" DEFINE BUTTON OF oBar FILENAME
"..\bitmaps\16x16\open.bmp" FLAT ;
ACTION MsgInfo( cGetFile
( "*.*",
"Select a document to open" ) ) ;
TOOLTIP
"Opens a document" WHEN .f.
DEFINE BUTTON OF oBar FILENAME
"..\bitmaps\16x16\floppy.bmp" FLAT ;
ACTION MsgInfo( Time
() ) TOOLTIP
"Saves this document" DEFINE BUTTON OF oBar FILENAME
"..\bitmaps\16x16\printer.bmp" FLAT ;
ACTION MsgInfo( "Prints this document" ) TOOLTIP
"Print this document" GROUP
DEFINE BUTTON OF oBar FILENAME
"..\bitmaps\16x16\prop.bmp" FLAT ;
ACTION PrinterSetup
() TOOLTIP
"Setup the printer" DEFINE BUTTON OF oBar FILENAME
"..\bitmaps\16x16\HelpInd.bmp" FLAT ;
ACTION MsgInfo( Version
() ) TOOLTIP
"A multiple lines" + ;
Chr
( 13 ) + Chr
( 10 ) +
"tooltip!" GROUP
DEFINE BUTTON OF oBar FILENAME
"..\bitmaps\16x16\Help.bmp" FLAT ;
ACTION MsgInfo( "fivewin power!" ) TOOLTIP
"fivewin power!" DEFINE BUTTON OF oBar FILENAME
"..\bitmaps\16x16\Exit.bmp" FLAT ;
ACTION oWnd:
End() TOOLTIP
"Exit this app" GROUP
/*
DEFINE MESSAGE OF oWnd ;
PROMPT " Skype: joao@pleno.com.br " + FWVERSION + " " + FWCOPYRIGHT + ;
NOINSET CENTERED KEYBOARD DATE CLOCK
*/ DEFINE BITMAP oBmp FILENAME
"..\bitmaps\fiveback.bmp" oWnd:
bPainted =
{ | hDC | BmpTiled
( hDC, oWnd, oBmp
) } ACTIVATE WINDOW oWnd ;
VALID MsgYesNo
( "Do you want to quit ?" ) // Set( 29, ! Set( 29 ) ) IF Set
( _SET_INSERT, ! Set
( _SET_INSERT
) ) Set
( _SET_INSERT, ! Set
( _SET_INSERT
) ) ENDIFreturn nil//----------------------------------------------------------------------------//function BuildMenu
() local oMenu
MENU oMenu
MENUITEM "Information" MENU MENUITEM "&About..." ;
ACTION MsgInfo( FWDESCRIPTION
) ;
FILENAME
"..\bitmaps\16x16\info.bmp" SEPARATOR MENUITEM "&End..." ;
ACTION oWnd:
End() FILENAME
"..\bitmaps\16x16\exit.bmp" ENDMENU MENUITEM "&Clients" MENU MENUITEM "&New..." ;
ACTION ( MsgStop
( "New Clients" ),;
oWnd:
Say( 5,
5,
"New Clients...",
"GR+/G" ) ) ;
FILENAME
"..\bitmaps\16x16\faces.bmp" MENUITEM "&Modify..." ACTION MsgInfo( "Modif. Clients" ) ;
FILENAME
"..\bitmaps\edit.bmp" MENUITEM "&Delete..." ACTION MsgAlert
( "Del Clients" ) ;
FILENAME
"..\bitmaps\16x16\delete.bmp" SEPARATOR MENUITEM "&Browse..." ACTION MsgInfo( "Browse Clients" ) ;
FILENAME
"..\bitmaps\16x16\browse.bmp" ENDMENU MENUITEM "&Utilities" MENU MENUITEM "&Calculator..." ACTION WinExec
( "Calc" ) ;
FILENAME
"..\bitmaps\16x16\calc.bmp" MENUITEM "&Internet..." ;
ACTION WinExec
( "start iexplore http://www.fivetech.com",
0 ) ;
FILENAME
"..\bitmaps\16x16\explorer.bmp" ENDMENU ENDMENUreturn oMenu
//----------------------------------------------------------------------------//STATIC FUNCTION BmpTiled
( hDC, oWnd, oBmp
) local nWidth := oWnd:
nWidth(), nHeight := oWnd:
nHeight() local nRow :=
0, nCol :=
0, n
local nBmpWidth := oBmp:
nWidth(), nBmpHeight := oBmp:
nHeight() if oBmp:
hBitmap ==
0 return nil endif while nRow < nHeight
nCol =
0 while nCol < nWidth
PalBmpDraw
( hDC, nRow, nCol, oBmp:
hBitmap ) nCol += nBmpWidth
end
nRow += nBmpHeight
end
return nil//----------------------------------------------------------------------------//
Sorry,
I not understood
but U saw my question?
Re: get -oSortCbx
Posted: Sat Oct 23, 2021 4:46 am
by Antonio Linares
Silvio,
Instead of:
ON RESIZE oGet:setfocus()
use:
ON RESIZE oGet:PostMsg( WM_SETFOCUS )
Re: get -oSortCbx
Posted: Sat Oct 23, 2021 6:44 am
by Silvio.Falconi
Antonio Linares wrote:Silvio,
Instead of:
ON RESIZE oGet:setfocus()
use:
ON RESIZE oGet:PostMsg( WM_SETFOCUS )
I allready tested all two commands and not run ok
when I move the mdichild I not see the get control, then if I move the mouse over or another windows I see the get control
