Thanks.

I play with it via alien. And can change only height of tabs titles.

Example in attach (valid only for win32 environment, TCM_SETITEMSIZE sent only by spin changes, text input not handled).


11/26/2014 19:16, Antonio Scuri пишет:
This is possible only in Windows. And only when tabs is using a fixed size
for all tabs.

TCM_SETITEMSIZE message
Sets the width and height of tabs in a fixed-width or owner-drawn tab
control.
local iup = require("iuplua")

local alien = require("alien")

-- Windows message constants
local TCM_FIRST = 0x1300
local TCM_SETITEMSIZE = TCM_FIRST +41

local User32 = alien.load("User32.dll")
local SendMessage = User32.SendMessageA
SendMessage:types{abi="stdcall", ret="long", "uint", "uint", "uint", "uint"}

local function wid2hwnd(wid)
    return tonumber(tostring(wid):match("%x%x%x%x%x%x%x%x$"), 16)
end

local function set_tts(hwnd, w, h)
    local size = tonumber(("%04X%04X"):format(h, w), 16)
    --print("SIZE:", size, ("%08X"):format(size))
    return SendMessage(hwnd, TCM_SETITEMSIZE, 0, size)
end

local APP = {ttw=100, tth=16,}

APP.dlg = iup.dialog{
    SIZE = "QUARTERxQUARTER",
    iup.vbox{
        iup.tabs{
            iup.frame{TABTITLE="AAA", RASTERSIZE="200x100",},
            iup.frame{TABTITLE="BBBBBB", RASTERSIZE="200x100",},
            map_cb = function(this)
                -- save tabs handle
                APP.tabs = this
            end,
        },
        iup.frame{
            iup.vbox{
                iup.hbox{
                    ALIGNMENT = "ACENTER",
                    NORMALIZESIZE = "HORIZONTAL",
                    iup.label{TITLE = "TT Width",},
                    iup.text{
                        VALUE = APP.ttw,
                        SPIN = "YES",
                        SPINMAX = 1000,
                        spin_cb = function(this, pos)
                            APP.ttw = pos
                            set_tts(wid2hwnd(APP.tabs.WID), APP.ttw, APP.tth)
                        end,
                    },
                },
                iup.hbox{
                    ALIGNMENT = "ACENTER",
                    NORMALIZESIZE = "HORIZONTAL",
                    iup.label{TITLE = "TT Height",},
                    iup.text{
                        VALUE = APP.tth,
                        SPIN = "YES",
                        SPINMAX = 1000,
                        spin_cb = function(this, pos)
                            APP.tth = pos
                            set_tts(wid2hwnd(APP.tabs.WID), APP.ttw, APP.tth)
                        end,
                    },
                },
            },
        },
    },
}

APP.dlg:show(iup.CENTER, iup.CENTER)
set_tts(wid2hwnd(APP.tabs.WID), APP.ttw, APP.tth)

iup.MainLoop()

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to