1. TabControl size

SSB0cmllZCBTZXRDdHJsU2l6ZShUQUJDLDAuOTksMC45OSkgYW5kIHRoZSByZXN1bHRpbmcgY29u
dHJvbCB3YXMgbXVjaA0Kc21hbGxlciB0aGFuIHRoZSB3aW5kb3csIGFmdGVyIHNvbWUgZXhwZXJp
bWVudGluZyBJIGZvdW5kIHRoYXQNClNldEN0cmxTaXplKFRBQkMsMTA4Nyw3NzgpIHByb2R1Y2Vk
IHRoZSByaWdodCBzaXplIChhbGxvd2luZyBmb3INCnRpdGxlLCBzY3JvbGwgYW5kIHN0YXR1cyBi
YXJzKSBvbiBhIDEwMjQgeCA3Njggc2NyZWVuLiBTZWVtcyBhIGJpdCBvZGQNCmhhdmluZyB0byBz
cGVjaWZ5IDYzeDEwIG1vcmUgcGl4ZWxzIHRoYW4gdGhlcmUgYXJlIG9uIHRoZSBzY3JlZW4/DQoN
ClVzaW5nIHRoZSAyOXRoIE1hcmNoIDAuNTcuMSBsaWIuDQoNClBldGUNCg==

new topic     » topic index » view message » categorize

2. Re: TabControl size

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 message » categorize

3. Re: TabControl size

Just an idea, but are you defining your toolbars and statusbars before you
create other controls on the window? The recommendation is that one creates
a window, then any toolbars, then the statusbar and then the other controls.
This is because create() tries to use the client area to place controls in,
but it can only do that if toolbars and statusbars are already created,
since they reduce the client area.

Here is some sample code that seems to work okay on my machine:

-----------
without warning
include win32lib.ew
integer win, tc, ti
procedure pb(integer self, integer event, sequence parms)
        setCtlSize(tc,{0.99,-5},{0.99,-25})
end procedure

win = createEx(Window, "Test Tabcontrol", 0, 0, 0, 640, 480, 0, 0)
tc  = createEx(TabControl, "", win, 5, 25, {0.99,-5}, {0.99,-25}, 0, 0)
ti  = createEx(TabItem, "One", tc, 0, 0,0, 0, 0, 0)

setHandler(win, w32HResize, routine_id("pb"))
WinMain(win, Normal)
-----------
Derek.

----- Original Message -----
From: <petelomax at blueyonder.co.uk>
To: "EUforum" <EUforum at topica.com>
Sent: Thursday, April 25, 2002 1:44 PM
Subject: TabControl size


>
> 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 message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu