Re: TabControl size

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hey Pete,
 
Try this bit of code:

atom rect
rect = allocate(16)

c_proc(xGetClientRect,{hwnd, rect})

integer client_x1, client_x2, client_y1, client_y2 
client_x2 = peek4u(rect+8)
client_y2 = peek4u(rect+12)        

client_x2 will be the width of the client area
client_y2 will be the height of the client area
so you could now say this:

junk = c_func(xMoveWindow,{control,  x1,  y2, client_x2 - padX , client_y2 -
padY, 1})
'control' could be anythind created with CreateWindow
padX will be how far from the right edge of the client/window you want the 
control and padY well, you get the idea, it would be how far from the bottom

You could proceduralize the code: 

atom rect
rect = allocate(16)

procedure padcontrol(control)
integer client_x1, client_x2, client_y1, client_y2, padX, padY
  
PadX = 10
PadY = 10

   c_proc(xGetClientRect,{hwnd, rect})

   client_x2 = peek4u(rect+8)
   client_y2 = peek4u(rect+12)    
    
   -- Pad 10 pixels from right and 10 pixels from bottom of client rect
junk = c_func(xMoveWindow,{control,  x1,  y2, client_x2 - padX , client_y2 -
   padY, 1})

end procedure

free(rect)

forgive me if this isnt what you had in mind.

Hope it helps,
Euman

----- Original Message ----- 
From: <petelomax at blueyonder.co.uk>
 
> I tried SetCtrlSize(TABC,0.99,0.99) and the resulting control was much
> smaller than the window, after some experimenting I found that
> SetCtrlSize(TABC,1087,778) produced the right size (allowing for
> title, scroll and status bars) on a 1024 x 768 screen. Seems a bit odd
> having to specify 63x10 more pixels than there are on the screen?
> 
> Using the 29th March 0.57.1 lib.
> 
> Pete

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu