protected override void InitControl() { base.InitControl(); this.Bounds = new Rectangle(0, 0, 240, 26); if (IsSyncing) { BackColor = Color.LightGray; } lblPrimary = new FluidLabel("", 20, 0, 220, 20); lblPrimary.LineAlignment = StringAlignment.Near; lblPrimary.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; lblPrimary.Font = Theme.Current.ListPrimaryFont; Controls.Add(lblPrimary); lblSecondary = new FluidLabel("", 20, 14, 220, 14); lblSecondary.LineAlignment = StringAlignment.Near; lblSecondary.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top; lblSecondary.Font = Theme.Current.ListSecondaryFont; lblSecondary.ForeColor = Theme.Current.ListSecondaryForeColor; Controls.Add(lblSecondary); image = new FluidButton("", 2, 3, 16, 16); image.Anchor = AnchorStyles.None; image.BackColor = Color.Transparent; image.Shape = ButtonShape.Flat; image.Enabled = false; Controls.Add(image); }
public void ShowSelectButton(string buttonText) { selectButton = new FluidButton(string.IsNullOrEmpty(buttonText) ? "Select" : buttonText); selectButton.Click += new EventHandler(selectButton_Click); selectButton.BackColor = Theme.Current.HeaderSecondaryButtonBackColor; selectButton.GradientFill = Theme.Current.ButtonsGradianted; header.Buttons.Add(selectButton); }
protected override void InitControl() { base.InitControl(); Bounds = new Rectangle(0, 0, 240, 300); BackColor = Color.Green; Anchor = AnchorAll; const int h = 32; header.Bounds = new Rectangle(0, 0, 240, h); lsbFolders.Bounds = new Rectangle(0, h, 240, 260 - h); header.Anchor = AnchorTLR; lsbFolders.Anchor = AnchorAll; header.Title = "Sync Folders"; header.BackColor = Theme.Current.HeaderBackColor; header.GradientFill = Theme.Current.HeaderGradianted; header.ForeColor = Theme.Current.HeaderForeColor; header.BackButton.Click += new EventHandler(BackButton_Click); header.BackButton.Visible = true; header.BackButton.Shape = ButtonShape.Back; header.BackButton.TextOffset = new Point(6, 0); header.BackButton.Text = "Logout"; header.BackButton.BackColor = Theme.Current.LogoutButtonBackColor; header.BackButton.GradientFill = Theme.Current.ButtonsGradianted; FluidButton newFolderButton = new FluidButton("New"); newFolderButton.Click += new EventHandler(newFolderButton_Click); newFolderButton.BackColor = Theme.Current.HeaderSecondaryButtonBackColor; newFolderButton.GradientFill = Theme.Current.ButtonsGradianted; header.Buttons.Add(newFolderButton); lsbFolders.ItemClick += new EventHandler <ListBoxItemEventArgs>(lsbFolders_FolderSelected); lsbFolders.NavigateBack += new EventHandler(lsbFolders_Back); buttonPanel = new ButtonPanel(); buttonPanel.Bounds = new Rectangle(0, this.Height - 54, Width, 54); buttonPanel.Anchor = AnchorStyles.None; buttonPanel.Command += new EventHandler <CommandEventArgs>(buttonPanel_Command); Controls.Add(header); Controls.Add(lsbFolders); Controls.Add(buttonPanel); lsbFolders.ShowPath = true; lsbFolders.Items = Code.Settings.Instance.GetFolders(); //Update the SyncStatus UpdateSyncStatus(); }
public TextInputPanel(string labelText, int x, int y, int w, int h) : base(x, y, w, h) { Bounds = new System.Drawing.Rectangle(x, y, w, h); lblTitle = new FluidLabel(labelText, 10, 5, w - 20, 30); lblTitle.ForeColor = Color.White; lblTitle.Anchor = AnchorBL; lblTitle.Font = Theme.Current.ModalFont; Controls.Add(lblTitle); txtData = new FluidTextBox("", 10, 25, w - 20, 30); txtData.ForeColor = Color.Black; txtData.Anchor = AnchorBL; txtData.Font = Theme.Current.ModalFont; Controls.Add(txtData); btnOK = new FluidButton("OK", 10, 65, 80, 32); btnOK.BackColor = Color.Green; btnOK.GradientFill = Theme.Current.ButtonsGradianted; btnOK.Font = Theme.Current.ButtonFont; btnOK.Anchor = AnchorBL; btnOK.Click += new EventHandler(btnOK_click); Controls.Add(btnOK); btnKeyboard = new FluidButton("", 100, 65, 40, 32); btnKeyboard.Image = Resources.keyboard; btnKeyboard.BackColor = Color.White; btnKeyboard.Click += new EventHandler(btnKeyboard_Click); btnKeyboard.Anchor = AnchorBL; Controls.Add(btnKeyboard); btnCancel = new FluidButton("Cancel", 150, 65, 80, 32); btnCancel.BackColor = Color.Red; btnCancel.GradientFill = Theme.Current.ButtonsGradianted; btnCancel.Anchor = AnchorBL; btnCancel.Click += new EventHandler(btnCancel_click); Controls.Add(btnCancel); modalBackground = new ModalBackground(); modalBackground.ShowMaximized(); Anchor = AnchorAll; Show(); }
protected override void InitControl() { base.InitControl(); Bounds = new Rectangle(0, 0, 240, 300); BackColor = Color.Green; Anchor = AnchorAll; const int h = 32; lsbFolders.Bounds = new Rectangle(0, h, 240, 300 - h); lsbFolders.Anchor = AnchorAll; header.Bounds = new Rectangle(0, 0, 240, h); header.Anchor = AnchorTLR; header.Title = "/"; header.BackColor = Theme.Current.HeaderBackColor; header.ForeColor = Theme.Current.HeaderForeColor; header.GradientFill = Theme.Current.HeaderGradianted; header.BackButton.Click += new EventHandler(BackButton_Click); header.BackButton.BackColor = Theme.Current.HeaderBackButtonBackColor; header.BackButton.Visible = true; header.BackButton.Text = "Back"; header.BackButton.GradientFill = Theme.Current.ButtonsGradianted; FluidButton addFolderButton = new FluidButton("Add"); addFolderButton.Click += new EventHandler(addFolderButton_Click); addFolderButton.BackColor = Theme.Current.HeaderSecondaryButtonBackColor; addFolderButton.GradientFill = Theme.Current.ButtonsGradianted; header.Buttons.Add(addFolderButton); lsbFolders.FolderSelected += new EventHandler(lsbFolders_FolderSelected); Controls.Add(header); Controls.Add(lsbFolders); CurrentDir = new DirectoryInfo("/"); lsbFolders.Folders = MakeDirList(CurrentDir.GetDirectories()); }
protected override void InitControl() { Theme theme = Theme.Current; base.InitControl(); Bounds = new System.Drawing.Rectangle(0, 0, 240, ButtonHeight + LabelHeight); BackColor = theme.ButtonsBackColor; GradientFill = false; buttons[0] = btn1 = new FluidButton("", Space, ButtonTop, ButtonWidth, ButtonHeight); buttons[1] = btn2 = new FluidButton("", Space + (Space + ButtonWidth) * 1, ButtonTop, ButtonWidth, ButtonHeight); buttons[2] = btn3 = new FluidButton("", Space + (Space + ButtonWidth) * 2, ButtonTop, ButtonWidth, ButtonHeight); buttons[3] = btn4 = new FluidButton("", Space + (Space + ButtonWidth) * 3, ButtonTop, ButtonWidth, ButtonHeight); buttons[4] = btn5 = new FluidButton("", Space + (Space + ButtonWidth) * 4, ButtonTop, ButtonWidth, ButtonHeight); //Camera buttons[0].Image = Resources.camera; //New Folder buttons[1].Image = Resources.folder_add; //Delete Folder buttons[2].Image = Resources.folder_delete; //Paste buttons[3].Image = Resources.page_paste; //Back buttons[4].Image = Resources.application_side_contract; btn1.Command = "A"; btn2.Command = "B"; btn3.Command = "C"; btn4.Command = "D"; btn5.Command = "E"; foreach (FluidButton b in buttons) { b.Anchor = AnchorStyles.None; b.Shape = ButtonShape.Flat; b.BackColor = theme.ButtonsButtonBackColor; b.ForeColor = Color.White; b.PressedBackColor = Color.LightGray; } Controls.Add(btn1); Controls.Add(btn2); Controls.Add(btn3); Controls.Add(btn4); Controls.Add(btn5); //now add the labels var labelFont = new Font(FontFamily.GenericSerif, 7, FontStyle.Regular); label1 = new FluidLabel("Camera", Space, ButtonHeight - 2, ButtonWidth, LabelHeight); label1.Font = labelFont; label2 = new FluidLabel("New", Space + (Space + ButtonWidth) * 1 + 6, ButtonHeight - 2, ButtonWidth - 2, LabelHeight + 1); label2.Font = labelFont; label3 = new FluidLabel("Delete", Space + (Space + ButtonWidth) * 2 + 2, ButtonHeight - 2, ButtonWidth, LabelHeight + 1); label3.Font = labelFont; label4 = new FluidLabel("Paste", Space + (Space + ButtonWidth) * 3 + 4, ButtonHeight - 2, ButtonWidth - 3, LabelHeight + 1); label4.Font = labelFont; label5 = new FluidLabel("Back", Space + (Space + ButtonWidth) * 4 + 8, ButtonHeight - 2, ButtonWidth - 6, LabelHeight + 1); label5.Font = labelFont; Controls.Add(label1); Controls.Add(label2); Controls.Add(label3); Controls.Add(label4); Controls.Add(label5); }
protected override void InitControl() { Theme theme = Theme.Current; base.InitControl(); Bounds = new System.Drawing.Rectangle(0, 0, 240, ButtonHeight + 12); BackColor = theme.ButtonsBackColor; GradientFill = false; buttons[0] = btn1 = new FluidButton("", Space, ButtonTop, ButtonWidth, ButtonHeight); buttons[1] = btn2 = new FluidButton("", Space + (Space + ButtonWidth) * 1, ButtonTop, ButtonWidth, ButtonHeight); buttons[2] = btn3 = new FluidButton("", Space + (Space + ButtonWidth) * 2, ButtonTop, ButtonWidth, ButtonHeight); buttons[3] = btn4 = new FluidButton("", Space + (Space + ButtonWidth) * 3, ButtonTop, ButtonWidth, ButtonHeight); buttons[4] = btn5 = new FluidButton("", Space + (Space + ButtonWidth) * 4, ButtonTop, ButtonWidth, ButtonHeight); //Download/Save btn1.Image = Resources.disk; //Send btn2.Image = Resources.email_attach; //Copy btn3.Image = Resources.page_copy; //Delete btn4.Image = Resources.bin; //Close btn5.Image = Resources.cross; btn1.Command = "A"; btn2.Command = "B"; btn3.Command = "C"; btn4.Command = "D"; btn5.Command = "E"; foreach (FluidButton b in buttons) { b.Anchor = AnchorStyles.None; b.Shape = ButtonShape.Flat; b.BackColor = theme.ButtonsButtonBackColor; b.ForeColor = Color.White; b.PressedBackColor = Color.LightGray; } Controls.Add(btn1); Controls.Add(btn2); Controls.Add(btn3); Controls.Add(btn4); Controls.Add(btn5); //now add the labels var labelFont = new Font(FontFamily.GenericSerif, 7, FontStyle.Regular); label1 = new FluidLabel("Save", Space, ButtonHeight - 2, ButtonWidth, LabelHeight); label1.Font = labelFont; label2 = new FluidLabel("Email", Space + (Space + ButtonWidth) * 1, ButtonHeight - 2, ButtonWidth, LabelHeight); label2.Font = labelFont; label3 = new FluidLabel("Copy", Space + (Space + ButtonWidth) * 2, ButtonHeight - 2, ButtonWidth, LabelHeight); label3.Font = labelFont; label4 = new FluidLabel("Delete", Space + (Space + ButtonWidth) * 3, ButtonHeight - 2, ButtonWidth - 6, LabelHeight); label4.Font = labelFont; label5 = new FluidLabel("-Menu", Space + (Space + ButtonWidth) * 4, ButtonHeight - 2, ButtonWidth - 6, LabelHeight); label5.Font = labelFont; Controls.Add(label1); Controls.Add(label2); Controls.Add(label3); Controls.Add(label4); Controls.Add(label5); }
protected override void InitControl() { Theme theme = Theme.Current; base.InitControl(); Bounds = new System.Drawing.Rectangle(0, 0, 240, ButtonHeight + LabelHeight); BackColor = theme.ButtonsBackColor; GradientFill = false; buttons[0] = btn1 = new FluidButton("", Space, ButtonTop, ButtonWidth, ButtonHeight); buttons[1] = btn2 = new FluidButton("", Space + (Space + ButtonWidth) * 1, ButtonTop, ButtonWidth, ButtonHeight); buttons[2] = btn3 = new FluidButton("", Space + (Space + ButtonWidth) * 2, ButtonTop, ButtonWidth, ButtonHeight); buttons[3] = btn4 = new FluidButton("", Space + (Space + ButtonWidth) * 3, ButtonTop, ButtonWidth, ButtonHeight); buttons[4] = btn5 = new FluidButton("", Space + (Space + ButtonWidth) * 4, ButtonTop, ButtonWidth, ButtonHeight); //Sync Button buttons[0].Image = Resources.arrow_refresh; //Browse Dropbox Button buttons[1].Image = Resources.brick_go; //Settings Button buttons[2].Image = Resources.cog; //Info Button buttons[3].Image = Resources.information; //Info Button buttons[4].Image = Resources.door_in; btn1.Command = "A"; btn2.Command = "B"; btn3.Command = "C"; btn4.Command = "D"; btn5.Command = "E"; foreach (FluidButton b in buttons) { b.Anchor = AnchorStyles.None; b.Shape = ButtonShape.Flat; b.BackColor = theme.ButtonsButtonBackColor; b.ForeColor = Color.White; b.PressedBackColor = Color.LightGray; } Controls.Add(btn1); Controls.Add(btn2); Controls.Add(btn3); Controls.Add(btn4); Controls.Add(btn5); //now add the labels var labelFont = new Font(FontFamily.GenericSerif, 7, FontStyle.Regular); label1 = new FluidLabel("Sync", Space + 8, ButtonHeight - 2, ButtonWidth - 6, LabelHeight); label1.Font = labelFont; label2 = new FluidLabel("Dropbox", Space + (Space + ButtonWidth) * 1 - 1, ButtonHeight - 2, ButtonWidth + 2, LabelHeight + 1); label2.Font = labelFont; label3 = new FluidLabel("Settings", Space + (Space + ButtonWidth) * 2, ButtonHeight - 2, ButtonWidth, LabelHeight + 1); label3.Font = labelFont; label4 = new FluidLabel("Info", Space + (Space + ButtonWidth) * 3 + 8, ButtonHeight - 2, ButtonWidth - 6, LabelHeight + 1); label4.Font = labelFont; label5 = new FluidLabel("Exit", Space + (Space + ButtonWidth) * 4 + 8, ButtonHeight - 2, ButtonWidth - 6, LabelHeight + 1); label5.Font = labelFont; Controls.Add(label1); Controls.Add(label2); Controls.Add(label3); Controls.Add(label4); Controls.Add(label5); }
protected override void InitControl() { base.InitControl(); EnableDoubleBuffer = true; Bounds = new Rectangle(0, 0, 240, 300); this.BackColor = Color.FromArgb(33, 124, 197); this.PaintBackground += new EventHandler <FluidPaintEventArgs>(login_Paint); txtEmail = AddTextLabel("Email", 35, ref lblEmail, true); txtPassword = AddTextLabel("Password", 90, ref lblPassword, true); txtPassword.PasswordChar = '*'; txtEmail.GotFocus += new EventHandler(passwordTextBox_GotFocus); txtPassword.GotFocus += new EventHandler(passwordTextBox_GotFocus); btnRemember = new FluidButton("", 12, 150, 20, 20); btnRemember.BackColor = Color.White; btnRemember.PressedBackColor = Color.White; btnRemember.Image = null; btnRemember.Click += new EventHandler(btnRemember_Click); Controls.Add(btnRemember); lblRemember = new FluidLabel("Remember me?", 38, 150, 120, 20); lblRemember.Click += new EventHandler(btnRemember_Click); lblRemember.ForeColor = Color.Black; lblRemember.ShadowColor = Color.White; lblRemember.Font = new Font("Arial", 9, FontStyle.Bold); Controls.Add(lblRemember); btnLogin = new FluidButton("Login", 10, this.Height - 35, 80, 32); btnLogin.BackColor = Color.Green; btnLogin.Click += new EventHandler(btnLogin_Click); btnLogin.ForeColor = Color.Black; btnLogin.Anchor = AnchorBL; btnLogin.Font = Theme.Current.ButtonFont; Controls.Add(btnLogin); btnKeyboard = new FluidButton("", 100, this.Height - 35, 40, 32); btnKeyboard.Image = Resources.keyboard; btnKeyboard.BackColor = Color.White; btnKeyboard.Click += new EventHandler(btnKeyboard_Click); btnKeyboard.Anchor = AnchorBL; btnKeyboard.ShadowColor = Color.Black; Controls.Add(btnKeyboard); btnExit = new FluidButton("Exit", 150, this.Height - 35, 80, 32); btnExit.BackColor = Color.Red; btnExit.Click += new EventHandler(btnExit_Click); btnExit.ForeColor = Color.Black; btnExit.Anchor = AnchorBL; btnExit.Font = Theme.Current.ButtonFont; Controls.Add(btnExit); if (Settings.Instance != null) { if (Settings.Instance.RememberMe) { ////not too sure what to do here... //txtEmail.Text = Settings.Instance.UserEmail; //txtPassword.Text = Settings.Instance.UserPassword; rememberMe = true; btnRemember.Image = Resources.accept; } } }
protected override void InitControl() { base.InitControl(); Bounds = new Rectangle(0, 0, 240, 300); BackColor = Color.Green; Anchor = AnchorAll; const int h = 32; header.Bounds = new Rectangle(0, 0, 240, h); lsbDropbox.Bounds = new Rectangle(0, h, 240, 254 - h); header.Anchor = AnchorTLR; lsbDropbox.Anchor = AnchorAll; header.Title = "/"; header.BackColor = Theme.Current.HeaderBackColor; header.ForeColor = Theme.Current.HeaderForeColor; header.GradientFill = Theme.Current.HeaderGradianted; header.BackButton.Click += new EventHandler(BackButton_Click); header.BackButton.BackColor = Theme.Current.HeaderBackButtonBackColor; header.BackButton.Visible = true; header.BackButton.Text = "Back"; header.BackButton.GradientFill = Theme.Current.ButtonsGradianted; //Maybe make this an upload button...? FluidButton btnUpload = new FluidButton("Upload"); btnUpload.Click += new EventHandler(btnUpload_Click); btnUpload.BackColor = Theme.Current.HeaderSecondaryButtonBackColor; btnUpload.GradientFill = Theme.Current.ButtonsGradianted; header.Buttons.Add(btnUpload); Controls.Add(header); lsbDropbox.ItemClick += new EventHandler <ListBoxItemEventArgs>(lsbDropbox_ItemClick); lsbDropbox.NavigateBack += new EventHandler(BackButton_Click); Controls.Add(lsbDropbox); //Options Panel buttonPanel = new DropOptionButtonPanel(); buttonPanel.Bounds = new Rectangle(0, this.Height - 54, Width, 54); buttonPanel.Anchor = AnchorStyles.None; buttonPanel.Command += new EventHandler <CommandEventArgs>(buttonPanel_Command); Controls.Add(buttonPanel); //File Options Panel fileButtonPanel = new FileOptionButtonPanel(); fileButtonPanel.Bounds = new Rectangle(0, this.Height - 54, Width, 54); fileButtonPanel.Anchor = AnchorStyles.None; fileButtonPanel.Command += new EventHandler <CommandEventArgs>(fileButtonPanel_Command); fileButtonPanel.Hide(); Controls.Add(fileButtonPanel); _rootItem = Form1.Instance.DropBox.GetItems(); if (_rootItem == null) { //Failed Form1.Instance.OpenFoldersPanel(); Close(ShowTransition.FromBottom); MessageDialog.Show("Failed to Get Dropbox Folder", null, "OK"); } else { _selectedItem = _rootItem; lsbDropbox.Items = ListHelpers.MakeDirList(_rootItem); } }