| Schetti |
03-26-2009 03:14 PM |
With Scroll, FINALLY!
1 Attachment(s)
Now with scroll, smaller and also position = {}; extent = {}; stuff and better names(NewsTab etc.).
Also, if you want to use it(for those who didnt know)
Save it for example under -System/News
and after that, open the script for Control-NPC and add this
PHP Code:
function onActionPlayerOnline(){
addweapon("-System/News");
}
And this is the Final News-Window
PHP Code:
//#CLIENTSIDE
function onCreated()
{
NewsWindow = new GuiWindowCtrl("NewsWindow");
with (NewsWindow)
{
profile = "GuiBlueWindowProfile";
position = "640 390";
extent = "380 380";
canMove = true;
canResize = false;
canMaximize = false;
canClose = true;
tile = true;
text = "News";
new GuiControl(NewsTab)
{
visible = false;
profile = "GuiBlueControlProfile";
position = "10 52";
extent = "360 310";
new GuiScrollCtrl("NewsScroll") {
profile = GuiBlueScrollProfile;
position = { 5, 10};
extent = { 350, 300};
hscrollbar = "alwaysOff";
vscrollbar = "alwaysOn";
new GuiMLTextCtrl("NewsList") {
profile = GuiBlueMLTextProfile;
extent = { 518, 32};
horizsizing = "width";
text = "
Insert News here ^^
";
};
}
};
new GuiControl(HiringsTab)
{
visible = false;
profile = "GuiBlueControlProfile";
position = "10 52";
extent = "360 310";
new GuiScrollCtrl("HiringsScroll") {
profile = GuiBlueScrollProfile;
position = { 5, 10};
extent = { 350, 300};
hscrollbar = "alwaysOff";
vscrollbar = "alwaysOn";
new GuiMLTextCtrl("HiringsList") {
profile = GuiBlueMLTextProfile;
horizsizing = "width";
extent = { 347, 32};
text = "
Insert Hirings stuff here ^^
";
};
}
};
new GuiControl(StaffTab)
{
visible = false;
profile = "GuiBlueControlProfile";
position = "10 52";
extent = "360 310";
new GuiScrollCtrl("StaffScroll") {
profile = GuiBlueScrollProfile;
position = { 5, 10};
extent = { 350, 300};
hscrollbar = "alwaysOff";
vscrollbar = "alwaysOn";
new GuiMLTextCtrl("StaffList") {
profile = GuiBlueMLTextProfile;
horizsizing = "width";
position = { x, y};
extent = { 347, 32};
text = "
Insert staff list here ^^
";
};
}
};
new GuiTabCtrl(ExampleTabs)
{
profile = "GuiBlueTabProfile";
position = "10 28";
extent = "300 24";
clearRows();
with (addRow(0, "News"))
{
this.pane = NewsTab;
}
with (addRow(1, "Hirings"))
{
this.pane = HiringsTab;
}
with (addRow(2, "Staff"))
{
this.pane = StaffTab;
}
thiso.catchevent(name, "onSelect", "onTabSelect");
};
};
ExampleTabs.setSelectedById(0);
GraalControl.addControl(NewsWindow);
}
function onTabSelect(tabs)
{
for (temp.tab: temp.tabs.rows)
{
if (temp.tab.pane == null)
{
continue;
}
if (temp.tab == temp.tabs.selected)
{
temp.tab.pane.show();
}
else
{
temp.tab.pane.hide();
}
}
}
|