get -oSortCbx

get -oSortCbx

Postby Silvio.Falconi » Thu Oct 21, 2021 9:29 am

I add a get to make e search and it run ok only when I resize the Mdichild the get is not focused

before

Image

after ( when resize the mdichild and not move over any mouse or windows)

Image

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 view
 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 view
ACTIVATE WINDOW oWndEsercizi MAXIMIZED ;
      ON INIT oGet:setfocus() ;
      ON RESIZE  oGet:setfocus() ;
         VALID ( oWndEsercizi := nil, .T. )
   else
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7053
Joined: Thu Oct 18, 2012 7:17 pm

Re: get -oSortCbx

Postby Antonio Linares » Thu Oct 21, 2021 5:16 pm

Dear Silvio,

Please try it this way:

oGet:PostMsg( WM_SETFOCUS )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: get -oSortCbx

Postby Silvio.Falconi » Fri Oct 22, 2021 7:52 am

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 source

Code: Select all  Expand view
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
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7053
Joined: Thu Oct 18, 2012 7:17 pm

Re: get -oSortCbx

Postby karinha » Fri Oct 22, 2021 3:08 pm

// \samples\tutor04.prg modificado.

Code: Select all  Expand view

#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 ) )
   ENDIF

return 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
   ENDMENU

return 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

//----------------------------------------------------------------------------//
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7808
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: get -oSortCbx

Postby Silvio.Falconi » Fri Oct 22, 2021 7:07 pm

karinha wrote:// \samples\tutor04.prg modificado.

Code: Select all  Expand view

#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 ) )
   ENDIF

return 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
   ENDMENU

return 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?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7053
Joined: Thu Oct 18, 2012 7:17 pm

Re: get -oSortCbx

Postby Antonio Linares » Sat Oct 23, 2021 4:46 am

Silvio,

Instead of:
ON RESIZE oGet:setfocus()

use:
ON RESIZE oGet:PostMsg( WM_SETFOCUS )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: get -oSortCbx

Postby Silvio.Falconi » Sat Oct 23, 2021 6:44 am

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

Image
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7053
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 50 guests