combobox display

combobox display

Postby Richard Chidiak » Thu May 30, 2013 3: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

Image

Code: Select all  Expand view

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
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: combobox display

Postby ADutheil » Thu May 30, 2013 3: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
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: combobox display

Postby Richard Chidiak » Thu May 30, 2013 4: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
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: combobox display

Postby alerchster » Thu May 30, 2013 4: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
User avatar
alerchster
 
Posts: 64
Joined: Mon Oct 22, 2012 4:43 pm

Re: combobox display

Postby Antonio Linares » Thu May 30, 2013 4:30 pm

Richard,

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

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

Re: combobox display

Postby ADutheil » Thu May 30, 2013 6:31 pm

Another approach might be the way I do in my systems:

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

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: combobox display

Postby Richard Chidiak » Thu May 30, 2013 6: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
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: combobox display

Postby James Bott » 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: Select all  Expand view
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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 105 guests