Пример #1
0
            public void init(FactionNewForumPostsPanel.ForumPostData postData, int position, FactionNewForumPostsPanel parent, int yourRank)
            {
                this.m_parent   = parent;
                this.m_position = position;
                this.m_postData = postData;
                Graphics graphics = parent.CreateGraphics();
                Size     size     = graphics.MeasureString(postData.text, FontManager.GetFont("Arial", 9f, FontStyle.Regular), 630).ToSize();

                graphics.Dispose();
                int height = size.Height + 10;

                if (height < 0x20)
                {
                    height = 0x20;
                }
                this.clearControls();
                this.ClipVisible         = true;
                this.Size                = new Size(680, 0x19 + height);
                this.lightArea1.Size     = new Size(640, height);
                this.lightArea1.Position = new Point(40, 0x19);
                base.addControl(this.lightArea1);
                this.lightArea1.Create((Image)GFXLibrary.int_insetpanel_lighten_top_left, (Image)GFXLibrary.int_insetpanel_lighten_middle, (Image)GFXLibrary.int_insetpanel_lighten_top_right, (Image)GFXLibrary.int_insetpanel_lighten_middle, (Image)GFXLibrary.int_insetpanel_lighten_middle, (Image)GFXLibrary.int_insetpanel_lighten_middle, (Image)GFXLibrary.int_insetpanel_lighten_bottom_left, (Image)GFXLibrary.int_insetpanel_lighten_middle, (Image)GFXLibrary.int_insetpanel_lighten_bottom_right);
                NumberFormatInfo nFI = GameEngine.NFI;

                this.userName.Text      = postData.userName;
                this.userName.Color     = ARGBColors.Black;
                this.userName.Position  = new Point(9, 3);
                this.userName.Size      = new Size(280, 30);
                this.userName.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
                this.userName.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
                base.addControl(this.userName);
                this.dateLabel.Text      = postData.postTime.ToShortTimeString() + " " + postData.postTime.ToShortDateString();
                this.dateLabel.Color     = ARGBColors.Black;
                this.dateLabel.Position  = new Point(0x216, 3);
                this.dateLabel.Size      = new Size(0xa1, 30);
                this.dateLabel.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
                this.dateLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
                base.addControl(this.dateLabel);
                this.bodyLabel.Text      = postData.text;
                this.bodyLabel.Color     = ARGBColors.Black;
                this.bodyLabel.Position  = new Point(5, 5);
                this.bodyLabel.Size      = new Size(this.lightArea1.Width - 10, height - 5);
                this.bodyLabel.Font      = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
                this.bodyLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
                this.bodyLabel.setRightClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.copyTextToClipboardClick));
                this.lightArea1.addControl(this.bodyLabel);
                if (((yourRank == 1) || (yourRank == 2)) || (((postData.userID == RemoteServices.Instance.UserID) || RemoteServices.Instance.Admin) || RemoteServices.Instance.Moderator))
                {
                    this.deleteThread.ImageNorm  = (Image)GFXLibrary.trashcan_normal;
                    this.deleteThread.ImageOver  = (Image)GFXLibrary.trashcan_over;
                    this.deleteThread.ImageClick = (Image)GFXLibrary.trashcan_clicked;
                    this.deleteThread.Position   = new Point(680, 4);
                    this.deleteThread.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.deleteClicked), "FactionNewForumPostsPanel_delete_post");
                    base.addControl(this.deleteThread);
                }
                base.invalidate();
            }
 public void init(FactionNewForumPostsPanel.ForumPostData postData, int position, FactionNewForumPostsPanel parent, int yourRank)
 {
     this.m_parent = parent;
     this.m_position = position;
     this.m_postData = postData;
     Graphics graphics = parent.CreateGraphics();
     Size size = graphics.MeasureString(postData.text, FontManager.GetFont("Arial", 9f, FontStyle.Regular), 630).ToSize();
     graphics.Dispose();
     int height = size.Height + 10;
     if (height < 0x20)
     {
         height = 0x20;
     }
     this.clearControls();
     this.ClipVisible = true;
     this.Size = new Size(680, 0x19 + height);
     this.lightArea1.Size = new Size(640, height);
     this.lightArea1.Position = new Point(40, 0x19);
     base.addControl(this.lightArea1);
     this.lightArea1.Create((Image) GFXLibrary.int_insetpanel_lighten_top_left, (Image) GFXLibrary.int_insetpanel_lighten_middle, (Image) GFXLibrary.int_insetpanel_lighten_top_right, (Image) GFXLibrary.int_insetpanel_lighten_middle, (Image) GFXLibrary.int_insetpanel_lighten_middle, (Image) GFXLibrary.int_insetpanel_lighten_middle, (Image) GFXLibrary.int_insetpanel_lighten_bottom_left, (Image) GFXLibrary.int_insetpanel_lighten_middle, (Image) GFXLibrary.int_insetpanel_lighten_bottom_right);
     NumberFormatInfo nFI = GameEngine.NFI;
     this.userName.Text = postData.userName;
     this.userName.Color = ARGBColors.Black;
     this.userName.Position = new Point(9, 3);
     this.userName.Size = new Size(280, 30);
     this.userName.Font = FontManager.GetFont("Arial", 9f, FontStyle.Bold);
     this.userName.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     base.addControl(this.userName);
     this.dateLabel.Text = postData.postTime.ToShortTimeString() + " " + postData.postTime.ToShortDateString();
     this.dateLabel.Color = ARGBColors.Black;
     this.dateLabel.Position = new Point(0x216, 3);
     this.dateLabel.Size = new Size(0xa1, 30);
     this.dateLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.dateLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     base.addControl(this.dateLabel);
     this.bodyLabel.Text = postData.text;
     this.bodyLabel.Color = ARGBColors.Black;
     this.bodyLabel.Position = new Point(5, 5);
     this.bodyLabel.Size = new Size(this.lightArea1.Width - 10, height - 5);
     this.bodyLabel.Font = FontManager.GetFont("Arial", 9f, FontStyle.Regular);
     this.bodyLabel.Alignment = CustomSelfDrawPanel.CSD_Text_Alignment.TOP_LEFT;
     this.bodyLabel.setRightClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.copyTextToClipboardClick));
     this.lightArea1.addControl(this.bodyLabel);
     if (((yourRank == 1) || (yourRank == 2)) || (((postData.userID == RemoteServices.Instance.UserID) || RemoteServices.Instance.Admin) || RemoteServices.Instance.Moderator))
     {
         this.deleteThread.ImageNorm = (Image) GFXLibrary.trashcan_normal;
         this.deleteThread.ImageOver = (Image) GFXLibrary.trashcan_over;
         this.deleteThread.ImageClick = (Image) GFXLibrary.trashcan_clicked;
         this.deleteThread.Position = new Point(680, 4);
         this.deleteThread.setClickDelegate(new CustomSelfDrawPanel.CSDControl.CSD_ClickDelegate(this.deleteClicked), "FactionNewForumPostsPanel_delete_post");
         base.addControl(this.deleteThread);
     }
     base.invalidate();
 }