public PanelTabBar(WidgetTabBar tabBar) { InitializeComponent(); this.tabBar = tabBar; if (this.tabBar != null) { this.init(); } }
//--------------------------------------------------- //-------------------Constructeurs------------------- //--------------------------------------------------- public TabBarPropertyConverter(CoronaWidget widget, Form1 MainForm) : base(widget,MainForm) { this.tabBar = (WidgetTabBar)widget; }
private void saveButtonProperties(WidgetTabBar.TabBarButton button) { if(button != null) { button.Id = this.buttonNameTxtBx.Text; button.ImagePressedState = this.iconPressedPictBx.Image; button.ImageUnPressedState = this.iconReleasePictBx.Image; button.Label = this.labelButtonTxtBx.Text; button.FontName = this.fontNameTxtBx.Text; button.FontSize = (int)this.fontSizeNumUpDw.Value; button.LabelColor = this.colorButton.BackColor; button.CornerRadius = (int)this.conerRadiusUpDw.Value; button.Selected = this.isSelectedChkBx.Checked; if (button.ImagePressedState != null) button.ImagePressedState = new Bitmap(button.ImagePressedState, new Size((int)this.iconPressedWidthUpDw.Value, (int)this.iconPressedHeightUpDw.Value)); if (button.ImageUnPressedState != null) button.ImageUnPressedState = new Bitmap(button.ImageUnPressedState, new Size((int)this.iconReleasedWidthUpDw.Value, (int)this.iconReleaseHeightUpDw.Value)); } }
private void setButtonSelected(WidgetTabBar.TabBarButton buttonSelected) { if (buttonSelected != null) { this.buttonSelected = buttonSelected; this.buttonNameTxtBx.Text = buttonSelected.Id; this.iconPressedPictBx.Image = buttonSelected.ImagePressedState; this.iconReleasePictBx.Image = buttonSelected.ImageUnPressedState; this.labelButtonTxtBx.Text = buttonSelected.Label; this.fontNameTxtBx.Text = buttonSelected.FontName; this.fontSizeNumUpDw.Value = buttonSelected.FontSize; this.colorButton.BackColor = buttonSelected.LabelColor; this.conerRadiusUpDw.Value = buttonSelected.CornerRadius; this.isSelectedChkBx.Checked = buttonSelected.Selected; if (buttonSelected.ImagePressedState != null) { this.iconPressedWidthUpDw.Value = buttonSelected.ImagePressedState.Size.Width; this.iconPressedHeightUpDw.Value = buttonSelected.ImagePressedState.Size.Height; } if (buttonSelected.ImageUnPressedState != null) { this.iconReleasedWidthUpDw.Value = buttonSelected.ImageUnPressedState.Size.Width; this.iconReleaseHeightUpDw.Value = buttonSelected.ImageUnPressedState.Size.Height; } } }
/* private void addWidgetBt_Click(object sender, EventArgs e) { if (this.widgetTypeCmbBx.SelectedItem != null && this.gameElementTreeView1.LayerSelected != null) { string widgetType = this.widgetTypeCmbBx.SelectedItem.ToString(); CoronaLayer layer = this.gameElementTreeView1.LayerSelected; if(widgetType.Equals("TabBar")) { WidgetTabBar tabBar = new WidgetTabBar("WidgetTabBar" + layer.Widgets.Count, layer); layer.Widgets.Add(tabBar); this.gameElementTreeView1.newCoronaWidget(tabBar); } else if (widgetType.Equals("PickerWheel")) { WidgetPickerWheel pickerW = new WidgetPickerWheel("WidgetPickerWheel" + layer.Widgets.Count, layer); layer.Widgets.Add(pickerW); this.gameElementTreeView1.newCoronaWidget(pickerW); } } }*/ //-------------------------------------------------------------------------------------------- //-------------------- WIDGET CONTROL PANELS SECTION ----------------------------------------- //-------------------------------------------------------------------------------------------- //--- For the TABBAR WIDGET ---- public void openTabBarWidgetPanel(WidgetTabBar tabBar) { if (tabBar != null) { TabPage tabBarPage = new TabPage(tabBar.Name +" buttons"); tabBarPage.AutoScroll = true; PanelTabBar panel = new PanelTabBar(tabBar); tabBarPage.Controls.Add(panel); panel.Dock = DockStyle.Fill; this.tabControlArea2.Controls.Add(tabBarPage); } }