Author Topic: GUI Windows.  (Read 821 times)

Ok, I made a Gui yet when I open the Gui I can't close the gui and also I can not drag the GUI only the window moves not the buttons. Also right when I open the Gui the base of the Gui is far to the left of the buttons. Here is a pic.



Code: [Select]
if (!$CityGuiBinds)
{
$remapDivision[$remapCount] = "CityMod";
$remapName[$remapCount] = "Open gui";
$remapCmd[$remapCount] = "CityGui_Open";
$remapCount++;
$MyGuiBinds = 1;
}

function CityGui_Open()
{
canvas.pushDialog(CityGui);
}

I am guessing this code will close the Gui?
VVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVV
Code: [Select]
function CityGui_Close()
{
canvas.popDialog(CityGui);
}
« Last Edit: October 26, 2008, 01:19:46 PM by Kunit »

we need the code in the .gui file.
My guess is that you didnt put the buttons in window.

First GUI so I doubt I did either.

Edit~Buttons work but they don't move.
Code: [Select]
//--- OBJECT WRITE BEGIN ---
new GuiControl(CityGui) {
   profile = "GuiDefaultProfile";
   horizSizing = "right";
   vertSizing = "bottom";
   position = "0 0";
   extent = "640 480";
   minExtent = "8 2";
   visible = "1";

   new GuiWindowCtrl() {
      profile = "GuiWindowProfile";
      horizSizing = "right";
      vertSizing = "bottom";
      position = "0 0";
      extent = "112 248";
      minExtent = "8 2";
      visible = "1";
      text = "CityRP V1";
      maxLength = "255";
      resizeWidth = "1";
      resizeHeight = "1";
      canMove = "1";
      canClose = "1";
      canMinimize = "1";
      canMaximize = "1";
      minSize = "50 50";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 24";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"Citizen\");";
      text = "Citizin";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 49";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"ShopKeep\");\'Job\',\"Citizen\");";
      text = "ShopKeep";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 49";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"ShopKeep\");\'Job\',\"Citizen\");";
      text = "ShopKeep";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 74";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"Cop\");";
      text = "Cop";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 99";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"Criminal\");\");\'Job\',\"Citizen\");";
      text = "Criminal";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 124";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"Builder\");ShopKeep\");\'Job\',\"Citizen\");";
      text = "Builder";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 149";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"GunDealer\");";
      text = "Gun Dealer";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 174";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"Mafia\");";
      text = "Gangster";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 199";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"Burglar\");";
      text = "Burglar";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 224";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"Mayor\");";
      text = "Mayor";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
};
//--- OBJECT WRITE END ---

Code: [Select]
//--- OBJECT WRITE BEGIN ---
new GuiControl(CityGui) {
   profile = "GuiDefaultProfile";
   horizSizing = "right";
   vertSizing = "bottom";
   position = "0 0";
   extent = "640 480";
   minExtent = "8 2";
   visible = "1";

   new GuiWindowCtrl() {
      profile = "GuiWindowProfile";
      horizSizing = "right";
      vertSizing = "bottom";
      position = "0 0";
      extent = "112 248";
      minExtent = "8 2";
      visible = "1";
      text = "CityRP V1";
      maxLength = "255";
      resizeWidth = "1";
      resizeHeight = "1";
      canMove = "1";
      canClose = "1";
      canMinimize = "1";
      canMaximize = "1";
      minSize = "50 50";
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 24";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"Citizen\");";
      text = "Citizin";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 49";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"ShopKeep\");\'Job\',\"Citizen\");";
      text = "ShopKeep";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 49";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"ShopKeep\");\'Job\',\"Citizen\");";
      text = "ShopKeep";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 74";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"Cop\");";
      text = "Cop";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 99";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"Criminal\");\");\'Job\',\"Citizen\");";
      text = "Criminal";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 124";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"Builder\");ShopKeep\");\'Job\',\"Citizen\");";
      text = "Builder";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 149";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"GunDealer\");";
      text = "Gun Dealer";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 174";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"Mafia\");";
      text = "Gangster";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 199";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"Burglar\");";
      text = "Burglar";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
   new GuiBitmapButtonCtrl() {
      profile = "BlockButtonProfile";
      horizSizing = "left";
      vertSizing = "bottom";
      position = "7 224";
      extent = "99 19";
      minExtent = "8 2";
      visible = "1";
      command = "commandtoserver(\'Job\',\"Mayor\");";
      text = "Mayor";
      groupNum = "-1";
      buttonType = "PushButton";
      bitmap = "base/client/ui/button1";
      lockAspectRatio = "0";
      alignLeft = "0";
      overflowImage = "0";
      mKeepCached = "0";
      mColor = "255 255 255 255";
   };
  };
};
//--- OBJECT WRITE END ---

Looking at the current code, I think this edit will fix it. (They will appear in the window, but I have no idea if that would be the right position.)

This was not done in the GUI editor so I have no idea if it all would be correct. Most likely it would, though.