Page 1 of 1

How to clean scroll-bar in DCBROWSECOL?

Posted: Sun Aug 19, 2012 8:16 am
by Eugene Lutsenko
How to clean scroll-bar in DCBROWSECOL?

Re: How to clean scroll-bar in DCBROWSECOL?

Posted: Sun Aug 19, 2012 10:06 am
by rdonnay
@ .. DCBROWSE .. NOHSCROLL

Re: How to clean scroll-bar in DCBROWSECOL?

Posted: Sun Aug 19, 2012 10:59 am
by Eugene Lutsenko
Thanks!

Instead of prompt how to make visualization of the columns which quantity is in advance not known and is defined by the N_Cls parameter (in the given fragment of the program)? In this example in all columns their values, and value of the last column are displayed not.

Code: Select all

DCSETPARENT oBrowGrSc
DCBROWSECOL FIELD Rsp_it->Kod_Obj   HEADER "Код"                       PARENT oBrowse WIDTH 5
DCBROWSECOL FIELD Rsp_it->Name_Obj  HEADER "Наим.объекта расп.выборки" PARENT oBrowse WIDTH 22
DCBROWSECOL FIELD Rsp_it->Max_Value HEADER "MAX уров.сходства"         PARENT oBrowse WIDTH 5 COLOR GRA_CLR_RED
DCBROWSECOL FIELD Rsp_it->KodC_MaxV HEADER "Класс"                     PARENT oBrowse WIDTH 5 COLOR GRA_CLR_RED
DCBROWSECOL FIELD Rsp_it->Min_Value HEADER "MIN уров.сходства"         PARENT oBrowse WIDTH 5 COLOR GRA_CLR_BLUE
DCBROWSECOL FIELD Rsp_it->KodC_MinV HEADER "Класс"                     PARENT oBrowse WIDTH 5 COLOR GRA_CLR_BLUE
DCBROWSECOL FIELD Rsp_it->Dost      HEADER "Достоверность"             PARENT oBrowse WIDTH 5 
FOR j=1 TO N_Cls
    FieldName = "Rsp_it->CLS"+ALLTRIM(STR(j,15))
    HeadName  = "Класс:"+ALLTRIM(STR(j,15))     // Может быть можно писать наименования колонок вертикально?
    DCBROWSECOL FIELD &FieldName HEADER HeadName                       PARENT oBrowse WIDTH 6 
NEXT

Re: How to clean scroll-bar in DCBROWSECOL?

Posted: Sun Aug 19, 2012 11:19 am
by Auge_Ohr
Eugene Lutsenko wrote:

Code: Select all

FOR j=1 TO N_Cls
    FieldName = "Rsp_it->CLS"+ALLTRIM(STR(j,15))
    HeadName  = "Класс:"+ALLTRIM(STR(j,15)) 
    DCBROWSECOL FIELD &FieldName HEADER HeadName   PARENT oBrowse WIDTH 6 
NEXT
this seem me a Classic Problem of "detached local" ;)

Re: How to clean scroll-bar in DCBROWSECOL?

Posted: Sun Aug 19, 2012 11:29 am
by rdonnay
Are you sure that oBrowse is the correct parent?

Re: How to clean scroll-bar in DCBROWSECOL?

Posted: Sun Aug 19, 2012 12:09 pm
by Eugene Lutsenko
rdonnay wrote:Are you sure that oBrowse is the correct parent?
It seems yes. With the fixed set of columns all it is correctly to work. But here I in general cleaned PARENT, but everything works just as earlier (incorrectly). I tried different options but while it turned out nothing:

Code: Select all

/* ----- Create browse-1 ----- */

bScale := {|| Rsp_it->(DC_SetScope(0,Int_krit->KOD_IntKr)), ;
              Rsp_it->(DC_SetScope(1,Int_krit->KOD_IntKr)), ;
              Rsp_it->(DC_DbGoTop()),                       ;
              oBrowGrSc:refreshAll() }

@ 1, 0 DCBROWSE oBrowScale ALIAS 'Int_krit' SIZE 41.5,3.4 ;
       PRESENTATION DC_BrowPres()                         ;       // Только просмотр БД
       NOSOFTTRACK ;
       SCOPE ;
       NOHSCROLL NOVSCROLL ;       // Убрать горизонтальную и вертикальную полосы прокрутки
       ITEMMARKED {|| Eval(bScale), ;
                      DC_GetRefresh(GetList,, ;
                      DCGETREFRESH_TYPE_EXCLUDE,{GETLIST_BROWSE}) }

DCSETPARENT oBrowScale
DCBROWSECOL FIELD Int_krit->KOD_IntKr  HEADER 'Код'                   WIDTH 1
DCBROWSECOL FIELD Int_krit->NAME_IntKr HEADER 'Интегральный критерий' WIDTH 21


/* ----- Create browse-2 ----- */

DCSETPARENT TO

@ 5, 0 DCBROWSE oBrowGrSc ALIAS 'Rsp_it' SIZE 132,22 ;
       PRESENTATION DC_BrowPres() ;           // Только просмотр БД
       NOSOFTTRACK ;
       HEADLINES 3 ;                          // Кол-во строк в заголовке (перенос строки - ";")
       SCOPE ;
       ITEMMARKED bItems

// MAX - красным, MIN - синим

DCSETPARENT oBrowGrSc
DCBROWSECOL DATA {|x|x:=Rsp_it->Kod_Obj,  IIF(Empty(x),'',Str(x,5))} HEADER "Код"                       WIDTH 5
DCBROWSECOL FIELD Rsp_it->Name_Obj                                   HEADER "Наименование объекта;распознаваемой выборки" WIDTH 25
DCBROWSECOL DATA {|x|x:=Rsp_it->Max_Value,IIF(Empty(x),'',Str(x,5))} HEADER "MAX;уров.;сходства"        WIDTH 8 COLOR GRA_CLR_RED
DCBROWSECOL DATA {|x|x:=Rsp_it->KodC_MaxV,IIF(Empty(x),'',Str(x,5))} HEADER "Класс"                     WIDTH 5 COLOR GRA_CLR_RED
DCBROWSECOL DATA {|x|x:=Rsp_it->Min_Value,IIF(Empty(x),'',Str(x,5))} HEADER "MIN;уров.;сходства"        WIDTH 8 COLOR GRA_CLR_BLUE
DCBROWSECOL DATA {|x|x:=Rsp_it->KodC_MinV,IIF(Empty(x),'',Str(x,5))} HEADER "Класс"                     WIDTH 5 COLOR GRA_CLR_BLUE
DCBROWSECOL DATA {|x|x:=Rsp_it->Dost,     IIF(Empty(x),'',Str(x,5))} HEADER "Досто-;верность"           WIDTH 8 

FOR j=1 TO N_Cls
    FieldName = "Rsp_it->CLS"+ALLTRIM(STR(j,15))
    HeadName  = "Класс:"+ALLTRIM(STR(j,15))     // Может быть можно писать наименования колонок вертикально?
    DCBROWSECOL FIELD &FieldName HEADER HeadName WIDTH 7 
NEXT
*DCBROWSECOL FIELD Rsp_it->Int_krit  HEADER "Инт.критерий"  WIDTH 5 

DCGETOPTIONS SAYFONT '10.Helv Bold' TABSTOP AUTORESIZE

cTitle = '4.1.3.5. Подробная сжатая форма результатов распознавания'+'. Текущая модель: "'+UPPER(Ar_Model[M_CurrInf])+'"'

DCREAD GUI ;
   FIT ;
   OPTIONS GetOptions ;
   MODAL ;
   TITLE cTitle ;
   EVAL {|o|SetAppFocus(oBrowScale:GetColumn(1))}

Re: How to clean scroll-bar in DCBROWSECOL?

Posted: Sun Aug 19, 2012 7:29 pm
by Eugene Lutsenko
Auge_Ohr wrote:
Eugene Lutsenko wrote:

Code: Select all

FOR j=1 TO N_Cls
    FieldName = "Rsp_it->CLS"+ALLTRIM(STR(j,15))
    HeadName  = "Класс:"+ALLTRIM(STR(j,15)) 
    DCBROWSECOL FIELD &FieldName HEADER HeadName   PARENT oBrowse WIDTH 6 
NEXT
this seem me a Classic Problem of "detached local" ;)
And that it for problems: "detached local"?

Re: How to clean scroll-bar in DCBROWSECOL?

Posted: Mon Aug 20, 2012 8:51 am
by rdonnay
I don't see anything wrong with this code.
I suspect that the columns are not visible because they are scrolled off the screen.
Make the browse wider or make sure you have a horizontal scrollbar.

If that doesn't work, then I will help you with this if you can give me a small program that I can compile and run.

Re: How to clean scroll-bar in DCBROWSECOL?

Posted: Mon Aug 20, 2012 9:14 am
by Eugene Lutsenko
Thanks, Roger! You already solved this question in a subject:
http://bb.donnay-software.com:8080/phpB ... ?f=2&t=828
I experimented much, didn't come yet to that option which you corrected in this subject and it began to work as it is necessary. And that code didn't work and columns were visible, but with empty or with data from other columns.