problems with scrollbars

lucas123

New Member
Joined
Jun 6, 2010
Messages
85
Best answers
0
Reaction score
4
Look:
http://img42.imagesh...9/imagemjfq.jpg
shop.lua
Code:
local shopWindow
local shopButton
local shopTabBar
local premiumPanel
local itenPanel
local outfitPanel
function init()
  shopWindow = g_ui.displayUI('shop')
  shopWindow:hide()
  shopTabBar = shopWindow:getChildById('shopTabBar')
  shopTabBar:setContentWidget(shopWindow:getChildById('shopTabContent'))
  premiumPanel = g_ui.loadUI('premium')
  shopTabBar:addTab('Premium', premiumPanel, '/mods/shop/imagens/premium')
  --itenPanel = g_ui.loadUI('itens')
  --shopTabBar:addTab('Itens', itenPanel, '/mods/shop/imagens/iten')
  --outfitPanel = g_ui.loadUI('outfits')
  --shopTabBar:addTab('Outfits', outfitPanel, '/mods/shop/imagens/outfit')
  shopButton = modules.client_topmenu.addRightButton('shopButton', 'SHOP', 'imagens/shop', toggle)
end
function terminate()
  shopWindow:destroy()
  shopButton:destroy()
end
function toggle()
  if shopButton:isOn() then
    shopWindow:hide()
    shopButton:setOn(false)
  else
    shopWindow:show()
    shopButton:setOn(true)
  end
end
shop.otui
Code:
MainWindow
  id: shopWindow
  !text: tr('Draky Shop System')
  size: 480 340
  TabBarVertical
    id: shopTabBar
    anchors.top: parent.top
    anchors.left: parent.left
    anchors.bottom: parent.bottom
  Panel
    id: shopTabContent
    anchors.top: shopTabBar.top
    anchors.left: shopTabBar.right
    anchors.right: parent.right
    anchors.bottom: okButton.top
    margin-left: 10
    margin-bottom: 10
    ScrollablePanel
      id: scrollTab
      anchors.fill: parent
      margin-right: 12
      vertical-scrollbar: consoleScrollBar
      layout:
        type: verticalBox
        align-bottom: true
      border-width: 1
      border-color: #202327
      background: #00000066
      inverted-scroll: true
      padding: 1
    VerticalScrollBar
      id: consoleScrollBar
      anchors.top: parent.top
      anchors.bottom: parent.bottom
      anchors.right: parent.right
      step: 14
      pixels-scroll: true
  Button
    id: okButton
    !text: tr('Ok')
    width: 64
    anchors.right: parent.right
    anchors.bottom: parent.bottom
    @onClick: toggle()
premium.otui
Code:
Panel
  Button
    id: button1
    !text: 'vamos testar:'
    anchors.left: parent.left
    anchors.right: parent.right
    anchors.top: parent.top
    height: 75
    margin-top: 5
    margin-left: 10
    margin-right: 15
  Button
    id: button2
    !text: 'vamos testar2:'
    anchors.left: prev.left
    anchors.right: prev.right
    anchors.top: prev.bottom
    height: 75
    margin-top: 5
  Button
    id: button3
    !text: 'vamos testar2:'
    anchors.left: prev.left
    anchors.right: prev.right
    anchors.top: prev.bottom
    margin-top: 5
    height: 75
  Button
    id: button4
    !text: 'vamos testar2:'
    anchors.left: prev.left
    anchors.right: prev.right
    anchors.top: prev.bottom
    margin-top: 5
    height: 75
  Button
    id: button5
    !text: 'vamos testar2:'
    anchors.left: prev.left
    anchors.right: prev.right
    anchors.top: prev.bottom
    margin-top: 5
    height: 75
what is wrong? thanks all.
 
OP
L

lucas123

New Member
Joined
Jun 6, 2010
Messages
85
Best answers
0
Reaction score
4
@up..
plz tutorial to create panel with working scrollbar =x...
 

Quintinon

New Member
Joined
Aug 10, 2007
Messages
29
Best answers
0
Reaction score
0
It seems to me as if you don't have your buttons placed inside your scrollable area. You should try placing them inside of it.
(I think you need to space your 'buttons' section over until its "farther" than the scrollable section)
 

Summ

(\/)(;,,;)(\/) Y not?
Staff member
Global Moderator
Joined
Oct 15, 2008
Messages
4,160
Best answers
9
Reaction score
1,010
Location
Germany :O
You have to define the panel as a new widget in premium file like:
PremiumPanel < Panel

on init you then import the new styles like:
g_ui.importStyle("premium")

and then you add the premium panel as a child of the scroll panel:
scrollPanel = shopWindow:recursiveGetChildById('scrollTab')
premiumTab = g_ui.createWidget("PremiumPanel", scrollPanel)
 
OP
L

lucas123

New Member
Joined
Jun 6, 2010
Messages
85
Best answers
0
Reaction score
4
plz example..

its works with 1 tab but i need more.. how i can make for 4 itens on tab?
when changing selectec, change scrollTab too?
thanks Summ rep+
 
Top