On Wed, Jun 17, 2015 at 2:54 PM, Milind Gupta <milind.gu...@gmail.com>
wrote:

> Resending my previous email since it exceeded the size limit for the list.
> I will include the attachments in the following emails.
>
> Hi Antonio,
>          Thanks for the quick reply. I modified the program (as you
> suggested - attached). When I start the program and the dlg:show calls the
> resizematrix_cb for matA I see the values as shown in the attached image
> watch1.
>
> So now here is the 1st thing I don't understand. Why is matC which has
> more columns has a natural size in X which is smaller than matA which has 1
> less column? This is even before I do any modifications to the sizes of the
> columns.
>
> Now as soon as I resize matA rows and columns with my resize calculations
> the matA naturalsize and rastersize get bigger. So somehow something is not
> right in my calculations. Let me repeat my calculation rules I use:
>
> 1. Every cell has 8 pixels of decoration in X and in Y direction.
> 2. The matrix has a border of 2
> 3. rastersize is the actual size of the matrix control I can use when I
> include the matrix control border (2) and decoration for each cell (8)
> 4. rasterheightX and rasterwidthX gives the size of the cell after
> removing the decoration part (8).
>
> So with a rastersize dimension of X and n cells of dimensions x1,x2,...xn
> the following is true:
> X = 2+x1+x2+...+xn+8*n
>
> Is this not right? I am forcing the scroll bar to autohide by setting dx =
> xmax-xmin and dy=ymax-ymin.
>
> After I just resize matA cells (matC is not resized) the values change to
> as shown in the attached image watch2. My calculation distributed 459 to
> each cell width since it satisfied the equation 936 = 2+ 459*2 + 8*2  and
> the rows are 10 and 488 since they satisfy the equation 516 = 2 +
> 10+488+8*2 but when I do that the rastersize of A has changed from 936x516
> to 1010x531. I am not able to explain this.
>
> Thanks,
> Milind
>
> On Wed, Jun 17, 2015 at 10:21 AM, Antonio Scuri <sc...@tecgraf.puc-rio.br>
> wrote:
>
>>   Hi,
>>
>>   I didn't check all your calculations, but did you noticed that when the
>> dialog is resize you do the FitMat* twice? When MatA is resized, you
>> compute both, then MatC is also resized and you compute both again.
>>
>>   I think it would more interesting to set the size only of the
>> respective metrix inside resizematrix_cb.
>>
>>   And if the size is growing this means that you are setting a
>> combination of sizes that are larger than the current size. Must recheck
>> those calculations. Try inspecting the new sizes and comparing them to the
>> calculated size.
>>
>> Best,
>> Scuri
>>
>>
>>
>>
>> On Wed, Jun 17, 2015 at 12:50 PM, Milind Gupta <milind.gu...@gmail.com>
>> wrote:
>>
>>> I think the problem may be occurring because of the following which I
>>> don't understand:
>>>
>>> I have a iuptabs control that starts off with a size of 776x361
>>> clientsize (which is the same as either matrix rastersize.) I have 2 matrix
>>> controls in the 2 tabs and I resize its rows and columns as follows:
>>>
>>> matA has 2 rows (including title) and 2 columns (no column title). Title
>>> row rasterheight = 10 (fixed) row 1 rasterheight = 333 (adjusted to occupy
>>> the remaining height of the matrix). This should give the total matrix
>>> height of 333+10+2*8+2 = 361 which matches the height of the matrix. (2 is
>>> for the border and 8 for the cell decorations)
>>>
>>> matA has 2 columns with no title. Both columns are distributed the space
>>> equally. So their rasterwidth is set to 379 both. That should give the
>>> total matrix width of:
>>>     379*2+2*8+2 = 776  which matches the width of the matrix
>>>
>>> matC has 2 rows same as matA and they are given the same size of 10 and
>>> 333
>>>
>>> matC has 3 columns. 1st column is fixed at 12 the remaining 2 columns
>>> get the space equally and are set to 369. This should give the matrix width
>>> of:
>>>    369*2+8*3+12+2 = 776 which matches the width of the matrix
>>>
>>> *After these sizings happen the natural size and rastersize of matA
>>> changes to  850x376 and the natural size of matC changes to 791x376 while
>>> its rastersize if 850x376. The iuptabs natural size and rastersize changes
>>> to 858x407*
>>>
>>> I don't understand why does the natural and rastersize of the matrix
>>> elements and iuptabs change when I resize the columns to precisely fit in
>>> their current rastersize? Am I calculating something wrong here?
>>>
>>> Thanks for any help.
>>>
>>> Milind
>>>
>>>
>>> On Tue, Jun 16, 2015 at 11:41 PM, Milind Gupta <milind.gu...@gmail.com>
>>> wrote:
>>>
>>>> Hi,
>>>>         I have this sample attached. The aim is to resize the matrix
>>>> columns and cells automatically depending on the weight assigned to the
>>>> columns whenever the dialog is resized. The sizing algorithm works fine
>>>> when I trace the steps of the sizes allotted to different columns.
>>>>         The problem is that after a few resize iterations the iuptab
>>>> size suddenly becomes larger than the dialog clientsize. I am not able to
>>>> explain that and that causes the automatic resizing of the matrix not to
>>>> work as intended.
>>>>         I would really appreciate any help as to why the tabs size
>>>> increases beyond the dialog client size.
>>>>
>>>> Thanks,
>>>> Milind
>>>>
>>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Iup-users mailing list
>>> Iup-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/iup-users
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>>
>> _______________________________________________
>> Iup-users mailing list
>> Iup-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/iup-users
>>
>>
>

Attachment: dialog.lua
Description: Binary data

------------------------------------------------------------------------------
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to