[Openroad-users] Ellipseshape in a tablefield...

Andrew andrew at delta-link.com.au
Mon Nov 26 21:27:45 EST 2007


Thanks Simon.


Simon Lovell wrote:
> It's not possible to change part of a cell which contains a complex 
> field directly.  What might be possible is to set the background of the 
> cell and then set the ellipseshape background to clear.  Perhaps someone 
> else has tried this?
>
> HTH.
>
> Andrew wrote:
>
>   
>> Hi All,
>>
>> OR4.1 sp3 - WinXp
>>
>> I am having some issues changing the bgcolor of an ellipseshape in 
>> tablefield and require a little assistance...
>>
>> I started by having about 10 entryfields and an ellipseshape (called 
>> dot), then grouped them into a matrixfield.
>> Then I grouped the matrixfield into a stackfield.
>> Named the stackfield - col1.
>> Cloned the stackfield twice and called them col2 and col3.
>> Then grouped col1, col2 and col3 into a tablefield (called tbl1).
>>
>> Now I would like to change the background colour of 'dot' when some 
>> data changes in any of the entryfields.
>>
>> My attempts so far have changed the bgcolor of 'dot' in the correct 
>> column but for every row not just the one where the data has changed 
>> (just like if I was using protofield but I'm not).
>>
>> So I have tried a variety of 'for loops' going through the tablefield 
>> to get to the ellipseshape - in the attached file, but today is just a 
>> cow of a day. This could all be avoided by just using a togglefield 
>> but we would like to use an ellipseshape if possible. Please forgive 
>> me if the code is a little confusing.
>>
>> Any help will be greatly appreciated.
>>
>> Regards,
>> Andrew.
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>>
>> FIELD EVENT CODE EXTRACT...
>> ...
>>    rowno = field(tbl1).currow;
>>    colname = 'col1';   // hardcoded for now.
>>
>>    use_next = '';
>>    stop_count = 0;
>>    found_ellipseshape = null;
>>    callproc lp_dig ( rowno = rowno, colname = colname, fldobj = field(tbl1));
>>
>>    if (found_ellipseshape is not null) then
>>        found_ellipseshape.bgcolor = cc_pale_red;
>>    endif;
>> ...
>>
>>
>> // Local procedure.
>> procedure lp_dig (
>>    rowno       = integer not null;
>>    colname     = varchar(100) not null,
>>    fldobj      = fieldobject default null;
>>    comfld      = compositefield default null;
>> )=
>> declare
>>    i = integer not null;
>>    frmfld  = Formfield default null;
>>    tblfld  = TableField default null;
>> {
>>    if (found_ellipseshape is not null) then
>>        return;
>>    endif;
>>
>>    stop_count = stop_count + 1;
>>    if (stop_count >= 1000) then
>>        // Good to have when tinkering.
>>        message '===stop processing===loop out of control===';
>>        return;
>>    endif;
>>
>>    if (fldobj is not null) then
>>        if (fldobj.IsA( class = compositefield ) = true) then
>>            callproc lp_dig (rowno = rowno, colname = colname, comfld = compositefield(fldobj));
>>        endif;
>>        return;
>>    endif;
>>
>>    if (comfld is not null) then
>>
>>        for i = 1 to comfld.childfields.lastrow do
>>
>>            frmfld = formfield(comfld.childfields[i]);
>>            if (frmfld.IsA( class = columnfield ) = true) then
>>                tblfld = columnfield(frmfld).parenttable;
>>                
>>                // Need some way to find out what row an I currently looking at...
>>                //if (on_the_right_columns ???...  frmfld.name = colname
>>                //and on_the_right_row  ???...tblfld.currow = rowno) then
>>                    use_next = 'Y';
>>                //endif;
>>            endif;
>>
>>            if (frmfld.IsA( class = compositefield ) = true) then
>>
>>                callproc lp_dig(rowno = rowno, colname = colname, comfld = comfld.ChildFields[i]);
>>
>>            elseif (frmfld.IsA( class = ellipseshape ) = true) then
>>
>>                if (use_next = 'Y') then
>>                    // This must be some sort of protofield??????
>>                    message 'XXX ellipse found...' + frmfld.fullname);
>>                    found_ellipseshape = EllipseShape(frmfld);
>>                    return;
>>                endif;
>>            endif;
>>        endfor;
>>    endif;
>>
>>    return;
>> }
>>  
>>
>> ------------------------------------------------------------------------
>>
>>     
>


More information about the Openroad-users mailing list