Menu

#82 How to choose an element in @ x,y get combobox

v1.0_(example)
open
nobody
None
1
2024-06-05
2024-05-19
No

Hi,

I tried this syntax with on init, but it doesn't do the job
~~~
public agMois:={"Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"}

BEGIN PAGE "Grégorien vers Révolutionnaire" OF oTab
@ 10,10 SAY cText01 SIZE 135, 22 COLOR hwg_ColorC2N("0000FF")
@ 15,32 GET COMBOBOX cgAn ITEMS agAn STYLE WS_TABSTOP SIZE 100, 25 ;
TEXT

  @ 155,10 SAY cText02 SIZE 135, 22 COLOR hwg_ColorC2N("0000FF")
  @ 140,32 GET COMBOBOX cgMois ITEMS agMois STYLE WS_TABSTOP SIZE 150,25;            TEXT ON INIT {||cgMois:=agMois[9]}

  @ 310,10 SAY cText03 SIZE 130, 22 COLOR hwg_ColorC2N("0000FF")
  @ 335,32 GET COMBOBOX cgJour ITEMS agJour STYLE WS_TABSTOP ;
         SIZE 60, 25 TEXT

END PAGE OF oTab
~~~
Is there a way to do it ?

Thanks
A+

Related

Support Requests: #82

Discussion

  • Alexander S.Kresin

    Just initialize a combobox variable with a necessary value before:

    cgMois:=agMois[9]
    ...
    @ 140,32 GET COMBOBOX cgMois ITEMS agMois ...

    Regards, Alexander

     
  • Aupeix Alain

    Aupeix Alain - 2024-06-03

    Hi,

    ok for this sample, but I have others combobox where the elements are very high, (about 300), and where the initialisation can't be used.

    Is there a way to have an empty element as first element, and the way to enter something to directly find this element ?

    Thanks
    A+

     
    • richard roesnadi

      300 recs is table size, why not using valid browse dbf or array?

      Pada Sel, 4 Jun 2024 00.00, Aupeix Alain jujuland@users.sourceforge.net
      menulis:

      Hi,

      ok for this sample, but I have others combobox where the elements are very
      high, (about 300), and where the initialisation can't be used.

      Is there a way to have an empty element as first element, and the way to
      enter something to directly find this element ?

      Thanks
      A+


      [support-requests:#82]
      https://sourceforge.net/p/hwgui/support-requests/82/ How to choose an
      element in @ x,y get combobox

      Status: open
      Group: v1.0_(example)
      Created: Sun May 19, 2024 09:12 AM UTC by Aupeix Alain
      Last Updated: Thu May 23, 2024 12:22 PM UTC
      Owner: nobody

      Hi,

      I tried this syntax with on init, but it doesn't do the job
      ~~~
      public
      agMois:={"Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"}

      BEGIN PAGE "Grégorien vers Révolutionnaire" OF oTab
      @ 10,10 SAY cText01 SIZE 135, 22 COLOR hwg_ColorC2N("0000FF")
      @ 15,32 GET COMBOBOX cgAn ITEMS agAn STYLE WS_TABSTOP SIZE 100, 25 ;
      TEXT

      @ 155,10 SAY cText02 SIZE 135, 22 COLOR hwg_ColorC2N("0000FF") @ 140,32 GET COMBOBOX cgMois ITEMS agMois STYLE WS_TABSTOP SIZE 150,25; TEXT ON INIT {||cgMois:=agMois[9]}
      @ 310,10 SAY cText03 SIZE 130, 22 COLOR hwg_ColorC2N("0000FF") @ 335,32 GET COMBOBOX cgJour ITEMS agJour STYLE WS_TABSTOP ; SIZE 60, 25 TEXT

      END PAGE OF oTab
      ~~~
      Is there a way to do it ?

      Thanks
      A+


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/hwgui/support-requests/82/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Support Requests: #82

  • Aupeix Alain

    Aupeix Alain - 2024-06-05

    Hi,

    I don't want here to use browse here, and it's already an array which has now 354 elements, and will quickly grow to one hundred more ...
    Here are the elements structure :

    ...
    Télérama 2374 grille 304
    ...
    Télérama 3642 grille 912
    Télérama 3643 grille 913
    Télérama 3644 grille 914
    ...
    

    Here is a way, not really what I want, but it helps a little, and is really faster than browsing or searching in a combobox.
    The only ennoying detail, is that I must use UP or DOWN keys too change the element, else it begins at the beginning of the array. Bus, when we know it, it's not really a problem.

    cTitle=hwg_MsgGet( "Donner titre [ et numéro de grille ]", "Titre de la grille[,numéro de la grille]",,oMainWindow:nLeft+180,oMainWindow:nTop+130,, "" )
    if at(",",cTitle) > 0
       rg=ascan(aGrilles,{|x|trim(left(cTitle,at(",",cTitle)-1))$x .and. substr(cTitle,rat(",",cTitle)+1)$x})
       if rg > 0
          cTitle=aGrilles[rg]
       endif
    else
       rg=ascan(aGrilles,{|x|trim(cTitle)$x})
       if rg > 0
          cTitle=aGrilles[rg]
       endif
    endif
    
    INIT DIALOG oxchoice TITLE "Export ClipWord" AT oMainWindow:nLeft+180,oMainWindow:nTop+130 ;
       SIZE 320,120 FONT oFont ICON HIcon():AddString( "export" , cVal_export )
    
       // Taille fixe
       hwg_WindowSetResize( oxchoice:handle, .F. )
    
       @ 10,10   say "Choisissez la grille à exporter" SIZE 220, 22 COLOR hwg_ColorC2N("FF0000")
       @ 10,34   GET COMBOBOX oGrilles VAR ctitle ITEMS aGrilles STYLE WS_TABSTOP SIZE 300, 25;
                 TOOLTIP "Choix de la grille à exporter" TEXT
    
       @ 60, 75  BUTTON "Ok" OF oxchoice ID IDOK  ;
                 SIZE 90, 32 COLOR hwg_ColorC2N("FF0000") ;
                 ON CLICK {||oxchoice:lresult:=.t.}
       @ 170,75  BUTTON "Annuler" OF oxchoice ID IDCANCEL SIZE 90, 32 ;
                 ON CLICK {||rJoueur:=""}
    
       hwg_SetDlgKey( oxchoice, 0, VK_F1, {|| Help("who") } )
    
    ACTIVATE DIALOG oxchoice
    

    The blank element at the beginning just ought to do about the same thing, without needing hwg_MsgGet()

    A+

     

    Last edit: Aupeix Alain 2024-06-05

Log in to post a comment.