Hi Antonio, Thanks for the quick reply. I modified the program (as attached). When I start the program and the dlg:show calls the resizematrix_cb for matA I see the following values (as shown in the pasted and attached image watch1):
[image: Inline image 1] 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. 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 > >
dialog.lua
Description: Binary data
------------------------------------------------------------------------------ Monitor 25 network devices or servers for free with OpManager! OpManager is web-based network management software that monitors network devices and physical & virtual servers, alerts via email & sms for fault. Monitor 25 devices for free with no restriction. Download now http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users