To Nages : combobox not refresh xbrowse

To Nages : combobox not refresh xbrowse

Postby Silvio.Falconi » Mon Jan 03, 2022 11:28 am

Image


When I select a item on combobox it no refresh the xbrowse with the order selected

this the sources

Code: Select all  Expand view
#INCLUDE "FIVEWIN.CH"
#INCLUDE "DBCOMBO.CH"
#INCLUDE "DTPICKER.CH"
MEMVAR oApp
// ----------------------------------------------------------------------- //
#DEFINE NUEVO_PRE NIL
#DEFINE NUEVO_PAC .T.
#DEFINE CLR_LGRAY   RGB( 255, 255, 255 )
#DEFINE CLR_LGREEN  RGB( 255, 248, 175 )
#DEFINE CLR_GRID1   RGB( 239, 239, 224 )
// ----------------------------------------------------------------------- //
CLASS TPaziente
   DATA oWin
   DATA oBar
   DATA oPaziente
   DATA oLbx
   DATA cTitulo
   DATA oTabs
   DATA oIcon


   // ----------------------------------------------------//
   METHOD New() CONSTRUCTOR
   METHOD Activar()
   METHOD Orden()

END CLASS

METHOD New() CLASS TPaziente
   LOCAL oFont1
   local cSeek:=Space(100)
   local oGet
   local oSay:=array(2)
   local oSelf:=self
   local cOrder := ""

  local  aCols    := { ;
        { "FIRST",  "First"        ,,   80, },;
        { "LAST",  "Last"        ,,   100, },;
        { "STREET",  "Street"        ,,   80, },;
        { "CITY",  "City"        ,,   100, },;
        { "STATE",  "State"        ,,   80, },;
        { "ZIP",  "Zip"        ,,   100, }}



  ::oPaziente := TClienti():New()
  ::oPaziente:SetOrder( "FIRST" )
  ::oPaziente:GoTop()
  ::cTitulo     := "Anagrafica pazienti"


   DEFINE ICON ::oIcon RESOURCE "ventana"

   DEFINE WINDOW ::oWin MDICHILD ;
      FROM 0, 0 TO 24, 79   ;
      TITLE ::cTitulo       ;
      ICON ::oIcon

   DEFINE BUTTONBAR ::oBar TOP _3D OF ::oWin

   SET FONT TO oApp:oFont OF ::oWin

   DEFINE BUTTON RESOURCE "Nuevo"    NOBORDER OF ::oBar          ;
      TOOLTIP "aggiungi"                                   ;
      ACTION NIL

   DEFINE BUTTON RESOURCE "editar"   NOBORDER OF ::oBar          ;
      TOOLTIP "Editar"                                           ;
      ACTION NIL

   DEFINE BUTTON RESOURCE "Elimin"   NOBORDER OF ::oBar          ;
      TOOLTIP "Eliminar"                                         ;

   DEFINE BUTTON RESOURCE "SEARCH"   NOBORDER OF ::oBar GROUP    ;
      TOOLTIP "Buscar"                                           ;

   DEFINE BUTTON RESOURCE "Repag"    NOBORDER OF ::oBar GROUP    ;
      TOOLTIP "Volver Pagina"                                    ;
      ACTION  ::oLbx:KeyDown(VK_PRIOR, 0)

   DEFINE BUTTON RESOURCE "AvPag"    NOBORDER OF ::oBar          ;
      TOOLTIP "Avanzar registro"                                 ;
      ACTION  ::oLbx:KeyDown(VK_NEXT, 0)

   DEFINE BUTTON RESOURCE "print"    NOBORDER OF ::oBar GROUP    ;
      TOOLTIP "Imprimir"                                         ;





   DEFINE FONT oFont1 NAME "Tahoma" SIZE 0, -12

    @ 2,280 say oSay[1] Prompt "Cerca :" SIZE 46,24 PIXEL OF ::oBar FONT oFont1
    @ 2,500 say oSay[2] Prompt "in" SIZE 40,24 PIXEL OF ::oBar FONT oFont1

    @ 2, 325 GET oGet VAR cSeek SIZE 150,20 PIXEL OF ::oBar  ;
                      BITMAP "ELIMINA" ACTION  (cSeek    := Space( 100 ),;
                      oSelf:oLbx:Seek( "" ),oSelf:oLbx:refresh(),oGet:refresh())
                       oGet:lBtnTransparent :=.t.


   ::oBar:bRClicked := {|| 0 }
   ::oBar:bLClicked := {|| 0 }

   @ 00, 00 TABS ::oTabs OF ::oWin PROMPT "Codigo", "Nombre"       ;
      ACTION ::Orden()

    @ 0,0 XBROWSE ::oLbx OF ::oWin ;
      DATASOURCE ::oPaziente COLUMNS aCols ;
      AUTOSORT ;
      NOBORDER CELL LINES

   * ::oLbx:aCols[ 3 ]:cSortOrder := ""   //no
   * ::oLbx:aCols[ 4 ]:cSortOrder := ""   //no
   * ::oLbx:aCols[ 5 ]:cSortOrder := ""   //no
   * ::oLbx:aCols[ 6 ]:cSortOrder := ""   //no

         WITH OBJECT ::oLbx
            :nRowHeight          := 30
            :l2007               := .F.
            :l2015               := .T.
            :nColDividerStyle    := LINESTYLE_LIGHTGRAY
            :nRowDividerStyle    := LINESTYLE_LIGHTGRAY
            :nStretchCol         := STRETCHCOL_WIDEST
            :lAllowRowSizing     := .F.
            :lAllowColSwapping   := .F.
            :lAllowColHiding     := .F.
            :nRecSelColor     :=   nRgb( 245,244,234)
            :lIncrFilter      := .t.
            :bOnSort          := { |b,oCol| oSelf:oLbx:Seek( "" ), ;
                                   oSelf:oLbx:cFilterFld := oCol:cExpr, ;
                                   oSelf:oLbx:SetFocus() }
            :bClrStd    := { || { CLR_BLACK, If( oSelf:oLbx:oCol( 1 ):Value, 0x80ffff, CLR_WHITE ) } }
            :bClrHeader       := {|| { ,nRgb( 245,244,234) } }
            :bClrFooter       := {|| { ,nRgb( 245,244,234) } }
            :lDrawBorder := .t.
            :lHScroll  := .f.
            :SetMultiSelectCol()
            :oSeek := oGet

            :CreateFromCode()
         END


   @ 2, 550 COMBOBOX oSelf:oLbx:oSortCbx VAR oSelf:oLbx:cSortOrder;
        SIZE 200,400 PIXEL OF ::oBar HEIGHTGET 18 STYLE CBS_DROPDOWN


     DEFINE BUTTON RESOURCE "salir"    NOBORDER OF ::oBar GROUP    ;
      TOOLTIP "Salir"                                            ;
      ACTION( ::oWin:End() )




      ::oWin:oClient := ::oLbx
      ::oWin:oControl := ::oLbx

 *  ::oWin:oClient := ::oLbx
 *  ::oWin:SetControl( ::oLbx )

   ::oTabs:nOption :=1
   ::oWin:oBottom := ::oTabs

RETURN Self
// ------------------------------------------------------------------------- //
METHOD Activar() CLASS TPaziente
   ACTIVATE WINDOW ::oWin MAXIMIZED
RETURN NIL
// ------------------------------------------------------------------------- //
METHOD Orden() CLASS TPaziente
  /* IF ::oTabs:nOption == 1 ; ::oPaziente:SetOrder( "CODIGO" )
   ELSE                    ; ::oPaziente:SetOrder( "NOMBRE" )
   ENDIF
   ::oLbx:refresh()
   ::oWin:Update() */


   IF ::oTabs:nOption == 1 ; ::oPaziente:SetOrder( "FIRST" )
   ELSE                    ; ::oPaziente:SetOrder( "LAST" )
   ENDIF
   ::oLbx:refresh()
   ::oWin:Update()
   RETURN NIL




 CLASS TClienti from TDatabase
   METHOD New()
ENDCLASS

METHOD New( lShared ) CLASS TClienti
   Default lShared := .t.
   ::super:New(,"CustomerI" ,"DBFCDX", lShared)
   if ::use()
      ::setOrder(1)
      ::gotop()
   endif
RETURN Self


 











Now I Make
@ 2, 550 COMBOBOX ::oLbx:oSortCbx VAR ::oLbx:cSortOrder;
SIZE 200,400 PIXEL OF ::oBar HEIGHTGET 18 STYLE CBS_DROPDOWN ;
ON CHANGE (oSelf:oTabs:nOption := oSelf:oLbx:oSortCbx:nat,;
oSelf:oTabs:refresh(),;
eval(oSelf:oTabs:baction))

AND SEEM TO RUN , but I think it should do it automatically, isn't it Nages?
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: 7034
Joined: Thu Oct 18, 2012 7:17 pm

Re: To Nages : combobox not refresh xbrowse

Postby Silvio.Falconi » Fri Jan 07, 2022 7:44 am

any solution please ?
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: 7034
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Natter and 48 guests