Thread: News-Window
View Single Post
  #24  
Old 03-26-2009, 03:14 PM
Schetti Schetti is offline
SC2 Player
Schetti's Avatar
Join Date: Nov 2008
Location: Austria
Posts: 269
Schetti is on a distinguished road
With Scroll, FINALLY!

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 = { 510};
      
extent = { 350300};
      
hscrollbar "alwaysOff";
      
vscrollbar "alwaysOn";


    new 
GuiMLTextCtrl("NewsList") { 

         
profile GuiBlueMLTextProfile;
         
extent = { 51832};   
        
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 = { 510};
      
extent = { 350300};
      
hscrollbar "alwaysOff";
      
vscrollbar "alwaysOn";


    new 
GuiMLTextCtrl("HiringsList") {
        
profile GuiBlueMLTextProfile
        
horizsizing "width";
extent = { 34732};
text "
Insert Hirings stuff here ^^

        "
;    
       
      };
    }
    };
    
    new 
GuiControl(StaffTab)
    {
      
visible    false;
      
profile    "GuiBlueControlProfile";
      
position   "10 52";
      
extent     "360 310";
      
    new 
GuiScrollCtrl("StaffScroll") {
      
profile GuiBlueScrollProfile;
      
position = { 510};
      
extent = { 350300};
      
hscrollbar "alwaysOff";
      
vscrollbar "alwaysOn";


    new 
GuiMLTextCtrl("StaffList") {
        
profile GuiBlueMLTextProfile
        
horizsizing "width";
        
position = { xy};
        
extent = { 34732};
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.tabtemp.tabs.rows)
  {
    if (
temp.tab.pane == null)
    {
      continue;
    }
    
    if (
temp.tab == temp.tabs.selected)
    {
      
temp.tab.pane.show();
    }
    else
    {
      
temp.tab.pane.hide();
    }
  }

Attached Thumbnails
Click image for larger version

Name:	News.jpg
Views:	176
Size:	17.1 KB
ID:	47843  
__________________
“Peace cannot be kept by force. It can only be achieved by understanding.” – Albert Einstein

Last edited by Schetti; 03-26-2009 at 04:57 PM..
Reply With Quote