FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour combobox display
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
combobox display
Posted: Thu May 30, 2013 03:02 PM
Hello

I have a problem with combobox displays (not due to recent versions).

I explain : I use tables where there is a description and an id , the table is added like this

AADD(MESVARS():TABVAR[12],ORI->LIBELLE + " " + STR(ORI->NUMERO,6) )

where there is a title and an id that i can retreive ,

i want the combobox to display the string (table) as it is , now it is "shrinking" it with trims and this is not good

i have set an image to explain it better, i need a fixed alignment for all items (items may include blank characters) , this is loaded from resource , i join the resource

Thanks for help,

Richard



Code (fw): Select all Collapse
STATDLG DIALOG DISCARDABLE 3, 12, 300, 228
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "Statistiques "
FONT 10, "Tahoma"
{
  CONTROL "OK", IDOK, "Button", BS_DEFPUSHBUTTON|WS_TABSTOP, 0, 204, 42, 21
  CONTROL "Annuler", IDCANCEL, "Button", WS_TABSTOP, 254, 205, 42, 21
  CONTROL "Sélection", 401, "Static", SS_CENTER|WS_BORDER|WS_GROUP, 1, 4, 60, 27
  CONTROL "Tous les Détails", 205, "Button", BS_RADIOBUTTON, 66, 99, 66, 12, WS_EX_TRANSPARENT
  CONTROL "Total Récapitulatif", 206, "Button", BS_RADIOBUTTON, 66, 112, 72, 12, WS_EX_TRANSPARENT
  CONTROL "Type de Statistiques", 402, "Static", SS_CENTER|WS_BORDER|WS_GROUP, 1, 99, 60, 27
  CONTROL "", 201, "ComboBox", WS_BORDER|CBS_DROPDOWNLIST|CBS_NOINTEGRALHEIGHT|WS_VSCROLL|WS_TABSTOP, 64, 4, 229, 135   <---------------- THIS IS THE COMBOBOX
  CONTROL "Période Sélectionnée", 403, "Static", SS_CENTER|WS_BORDER|WS_GROUP, 1, 53, 60, 27
  CONTROL "Du", 404, "Static", SS_CENTER|WS_BORDER|WS_GROUP, 63, 53, 23, 14
  CONTROL "", 207, "Edit", WS_BORDER|WS_TABSTOP, 90, 53, 60, 15
  CONTROL "Au", 405, "Static", SS_CENTER|WS_BORDER|WS_GROUP, 63, 73, 23, 14
  CONTROL "", 208, "Edit", WS_BORDER|WS_TABSTOP, 90, 73, 60, 15
  CONTROL "Format Export", 407, "Static", SS_CENTER|WS_BORDER|WS_GROUP, 140, 172, 60, 14
  CONTROL "ASCII (Texte)", 211, "Button", BS_RADIOBUTTON, 209, 184, 58, 12, WS_EX_TRANSPARENT
  CONTROL "Excel", 210, "Button", BS_RADIOBUTTON, 209, 169, 58, 12, WS_EX_TRANSPARENT
  CONTROL "Listing", 212, "Button", BS_RADIOBUTTON, 66, 142, 65, 12, WS_EX_TRANSPARENT
  CONTROL "Graphique", 213, "Button", BS_RADIOBUTTON, 66, 156, 65, 12, WS_EX_TRANSPARENT
  CONTROL "Type de Sortie", 406, "Static", SS_CENTER|WS_BORDER|WS_GROUP, 1, 145, 60, 17
  CONTROL "Fichier Exporté", 214, "Button", BS_RADIOBUTTON, 66, 172, 65, 12, WS_EX_TRANSPARENT
  CONTROL "Préciser Niveau Détail", 3, "Button", WS_TABSTOP, 140, 99, 90, 12
}
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: combobox display
Posted: Thu May 30, 2013 03:40 PM

Is your table DBF or SQL? If it´s SQL you could try padr( ORI->LIBELLE, N ).

Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: combobox display
Posted: Thu May 30, 2013 04:04 PM

André

It is dbf

i need to know why it is not displayed "like it is" (fixed length)

Richard

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 137
Joined: Mon Oct 22, 2012 04:43 PM
Re: combobox display
Posted: Thu May 30, 2013 04:29 PM

Hello Richard

You can use Font "Courier" or "Courier New" for your Dialog "STATDLG" instead of "Tahoma"

Another solution could be, create this dialog with code and use font "courier" only for this combobox.

Regards



Ing. Anton Lerchster
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: combobox display
Posted: Thu May 30, 2013 04:30 PM

Richard,

Have you tried to replace spaces with Chr( 9 ) (tabs) ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 368
Joined: Sun May 31, 2009 06:25 PM
Re: combobox display
Posted: Thu May 30, 2013 06:31 PM
Another approach might be the way I do in my systems:

Code (fw): Select all Collapse
AADD(MESVARS():TABVAR[12],STRZERO(ORI->NUMERO,2) + "-" + ORI->LIBELLE )
Regards,



André Dutheil

FWH 13.04 + HB 3.2 + MSVS 10
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: combobox display
Posted: Thu May 30, 2013 06:46 PM

Thank you all for your replies

Antonio with Chr( 9 ) same i had tried it also with alt+255 (invisible character) but same result no change

Anton the font does not make a change neither , courrier , courrier new or even system no change for the whole dialog or the combobox (it an be assigned with ocombo:setfont(....)

André : the Id in front of the table can help with small id's i have some tables where id's are 6 digits and needed and the problem is not only with numeric .

Maybe the only solution is to have a "clone" table holding id's one will display titles the other one id's , i wanted to avoid this (do not want to change many programs).

Richard

:?:

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: combobox display
Posted: Fri May 31, 2013 12:48 AM
Richard,

Maybe the only solution is to have a "clone" table holding id's one will display titles the other one id's , i wanted to avoid this (do not want to change many programs).


Does the user actually need to see the IDs? It sounds like you just need them for linking. If so, you can use a dbcombo which shows one field and returns a related field. Will that solve your problem?

Code (fw): Select all Collapse
redefine dbcombo cID ID ID_CLASS of oDlg;
   alias cAlias;
   itemfield "NUMERO" ;
   listfield "LIBELLE";
   update


The user selects LIBELLE and cID will contain the related NUMERO.

I always try to hide the ID's from the user. They can't remember IDs and IDs are usually needed only for the software's use.

Regards,
James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion