Page 1 of 1

Change of a format of the field DCBROWSECOL on button press

Posted: Wed Sep 12, 2012 12:09 pm
by Eugene Lutsenko
Prompt how to change, please, a format of display of the field DCBROWSECOL on button pressing. I can't transfer value of variables from function of processing of pressing of the button in that part of the program which will organize database display. As a result of a field are always displayed in a format which was set by the first and then I can't change it from the function started on pressing of the button at the displayed database.

Re: Change of a format of the field DCBROWSECOL on button pr

Posted: Wed Sep 12, 2012 2:46 pm
by rdonnay
Run Xdemo.Exe - Samples - Sample Group 1 - Picklist

Re: Change of a format of the field DCBROWSECOL on button pr

Posted: Wed Sep 12, 2012 11:28 pm
by Eugene Lutsenko
rdonnay wrote:Run Xdemo.Exe - Samples - Sample Group 1 - Picklist
Thanks! Because of problems of translation into English not always it is possible distinctly and to formulate to me accurately the thought in English, as in Russian. I meant not a set (list) of fields, and a format of display of the field, set in the dialogue opening on pressing of the button, during base viewing.

Re: Change of a format of the field DCBROWSECOL on button pr

Posted: Thu Sep 13, 2012 5:53 am
by Cliff Wiernik
You could always do this:

Code: Select all

  DCBROWSECOL DATA {|| ' '+TRANSFORM(LB_SSNFormat(SIMPLE->lIsCanada,SIMPLE->ssn1), ;
                                     LB_SSNPict(SIMPLE->lIsCanada)) } PARENT d_oBrowse ;        

where the data value is a code block and you can format anything here or you could do this:

  DCBROWSECOL FIELD TEMPLATE->sec_name PARENT d_oBrowse ;                    
    HEADER 'Name'  ;
    PICTURE {|| iif(recno()%2=0,'@K!','@K')} ;
    WIDTH m->G_nBrowColPixels * 28 PIXEL               
Either will allow you to change the format of a browse column cells data based on a button press.

You just refresh the browse.

Re: Change of a format of the field DCBROWSECOL on button pr

Posted: Thu Sep 13, 2012 5:57 am
by rdonnay
Are you asking a question or are you showing us how to do this?

Re: Change of a format of the field DCBROWSECOL on button pr

Posted: Thu Sep 13, 2012 10:39 am
by Eugene Lutsenko
I asked, because I am not able to do it. Generally I want to make a mode displaying different databases in one window (look drawing).
Image
To display what database the user sets in button pressing in the bottom of a window. Databases differ quantity and names of a line and columns and formats of display of data in columns. I made a similar mode, but it is not pleasant to me, as it turned out and not all at me and it turned out. I copy bases set for display in one base which I show. It clumsy and takes appreciable time at increase in dimension of databases. Thus I can not change a format and quantity of displayed columns. Certainly, I can make for each base separate function for display and cause it from the menu. I understand that it will work well. But it isn't pleasant to me, since these bases would need to be displayed on pressing of buttons in one window as they have similar sense and so they would need to be compared visually.

Re: Change of a format of the field DCBROWSECOL on button pr

Posted: Sun Sep 16, 2012 5:11 am
by Eugene Lutsenko
Made a call through the menu of three modules instead of one without any intricate decisions and everything perfectly works: both names of columns different and formats of visualization of fields what as it is necessary.

Re: Change of a format of the field DCBROWSECOL on button pr

Posted: Sun Sep 16, 2012 8:11 am
by rdonnay
Probably the best example of how to do what you want is DC_Dbu().

This is a database management system written in Xbase++ and eXpress++.

Have you used XDOT.EXE yet?

Re: Change of a format of the field DCBROWSECOL on button pr

Posted: Sun Sep 16, 2012 11:16 am
by Eugene Lutsenko
I at first thought to use DC_Dbu (), but then it seems more or less understood with editing of databases (including connected by the relation "one to many") by means of DCBROWSECOL and it me quite arranges. It will allow to make everything that is necessary. Program realization and longer ikhodny code can be a little simpler, but everything clearly and well works. Possibilities too rather flexible. Generally thank you for possibility to use your development. Without them everything would look much more gloomy. XDOT.EXE I started and looked, but yet didn't use.