## XIDInterf
Class XIIIMenuLiveFriendsCancelFriendRequest

source: C:\XIII\XIDInterf\Classes\XIIIMenuLiveFriendsCancelFriendRequest.uc

    Core.Object
       |
       +--GUI.GUI
          |
          +--GUI.GUIComponent
             |
             +--GUI.GUIMultiComponent
                |
                +--GUI.GUIPage
                   |
                   +--XIDInterf.XIIIWindow
                      |
                      +--XIDInterf.XIIILiveWindow
                         |
                         +--XIDInterf.XIIIMenuLiveFriendsCancelFriendRequest

Direct Known Subclasses:None

class XIIIMenuLiveFriendsCancelFriendRequest
extends XIDInterf.XIIILiveWindow

Variables
`string` | `ButtonNames`
`XIIIGUIButton` | `Buttons`
`string` | `TitleText`
`XboxLiveManager.FRIEND_PACKET` | `activeFriend`
`string` | `activeFriendName`
`XIIILiveMsgBox` | `msgbox`
`int` | `popupStatus`
`strRequested,` | `strCancelFriendRequestQuestion`

Function Summary
`void` | `Created()`
`void` | `InitComponent(GUIController MyController, GUIComponent MyOwner)`
`bool` | `InternalOnClick(GUIComponent Sender)`
    // Called when a button is clicked
`bool` | `InternalOnKeyEvent(out byte, out byte, float delta)`
`void` | `Paint(Canvas C, float X, float Y)`
`void` | `ReturnMsgBox(byte bButton)`
`void` | `ShowWindow()`

Source Code

    00001	class XIIIMenuLiveFriendsCancelFriendRequest extends XIIILiveWindow;
    00002
    00003	var localized string TitleText;
    00004
    00005	var XIIIGUIButton Buttons;
    00006	var localized string ButtonNames;
    00007	var localized string strRequested, strCancelFriendRequestQuestion;
    00008
    00009	var XboxLiveManager.FRIEND_PACKET activeFriend;
    00010	var string                        activeFriendName;
    00011
    00012	var XIIILiveMsgBox msgbox;
    00013	var int popupStatus;
    00014
    00015
    00016	function Created()
    00017	{
    00018	  local int i;
    00019	     Super.Created();
    00020	}
    00021
    00022
    00023	function InitComponent(GUIController MyController,GUIComponent MyOwner)
    00024	{
    00025
    00026	  Super.InitComponent(MyController, MyOwner);
    00027
    00028		Buttons = XIIIGUIButton(Controls[0]);
    00029		Buttons.Caption = ButtonNames;
    00030
    00031		OnClick = InternalOnClick;
    00032
    00033	}
    00034
    00035
    00036	function ShowWindow()
    00037	{
    00038	  OnMenu = 0; myRoot.bFired = false;
    00039	  Super.ShowWindow();
    00040	  bShowBCK = true;
    00041	  bShowRUN = false;
    00042	  bShowSEL = true;
    00043
    00044	  activeFriend = xboxlive.GetActiveFriend();
    00045	  activeFriendName = xboxlive.GetActiveFriendName();
    00046	  TitleText = activeFriendName $ " - " $ strRequested;
    00047
    00048	}
    00049
    00050
    00051	function Paint(Canvas C, float X, float Y)
    00052	{
    00053	     Super.Paint(C, X, Y);
    00054	  PaintStandardBackground(C, X, Y, TitleText);
    00055	}
    00056
    00057	function ReturnMsgBox(byte bButton)
    00058	{
    00059	  switch (bButton)
    00060	  {
    00061	    case QBTN_Ok:
    00062
    00063	      if (popupStatus == 1)
    00064	      {
    00065	        xboxlive.CancelFriendRequest(activeFriendName);
    00066	        myRoot.CloseMenu(true);
    00067	      }
    00068	      popupStatus = 0;
    00069	      return;
    00070	    break;
    00071
    00072	    case QBTN_Cancel:
    00073	      popupStatus = 0;
    00074	    break;
    00075
    00076	  }
    00077	}
    00078
    00079	// Called when a button is clicked
    00080	function bool InternalOnClick(GUIComponent Sender)
    00081	{
    00082	    local int i;
    00083	    if (Sender == Controls[0])
    00084	    {
    00085	      // remove friend
    00086	      Controller.OpenMenu("XIDInterf.XIIILiveMsgBox",false);
    00087	      msgbox = XIIILiveMsgBox(myRoot.ActivePage);
    00088	      msgbox.SetupQuestion(strCancelFriendRequestQuestion, QBTN_Ok | QBTN_Cancel, QBTN_Cancel, activeFriendName);
    00089	      msgbox.OnButtonClick=ReturnMsgBox;
    00090	      msgbox.InitBox(160*fRatioX, 130*fRatioY*fScaleTo, 16, 16, 320*fRatioX, 230*fRatioY*fScaleTo);
    00091
    00092	      popupStatus=1;
    00093
    00094	      //xboxlive.CancelFriendRequest(activeFriendName);
    00095	      //myRoot.CloseMenu(true);
    00096	      return true;
    00097	    }
    00098
    00099	    return true;
    00100	}
    00101
    00102
    00103	function bool InternalOnKeyEvent(out byte Key, out byte State, float delta)
    00104	{
    00105	    if (state==1/* || state==2*/)// IST_Press // to avoid auto-repeat
    00106	    {
    00107	        if ((Key==0x0D/*IK_Enter*/) || (Key==0x01))
    00108		    {
    00109	          //Controller.FocusedControl.OnClick(Self);
    00110	          InternalOnClick(Controller.FocusedControl);
    00111	          return true;
    00112		    }
    00113		    if ((Key==0x08/*IK_Backspace*/)|| (Key==0x1B))
    00114		    {
    00115		        myRoot.CloseMenu(true);
    00116	    	    return true;
    00117		    }
    00118		    if (Key==0x25/*IK_Left*/)
    00119		    {
    00120	    	    return true;
    00121		    }
    00122		    if (Key==0x27/*IK_Right*/)
    00123		    {
    00124	    	    return true;
    00125		    }
    00126	    }
    00127	    return super.InternalOnKeyEvent(Key, state, delta);
    00128	}
    00129
    00130
    00131

End Source Code