protected void AddSection(SettingsSection section) { SectionsContainer.Add(section); if (Sidebar != null) { var button = new SidebarButton { Section = section, Action = s => { SectionsContainer.ScrollTo(s); Sidebar.State = ExpandedState.Contracted; }, }; Sidebar.Add(button); if (selectedSidebarButton == null) { selectedSidebarButton = Sidebar.Children.First(); selectedSidebarButton.Selected = true; } } }
private void sbbReplies_Click(object sender, EventArgs e) { m_sbbSelected.Selected = false; sbbReplies.Selected = true; m_sbbSelected = sbbReplies; m_sbeSelected = SidebarButtonEnum.Replies; SidebarChanged(); }
private void sbbTimeline_Click(object sender, EventArgs e) { m_sbbSelected.Selected = false; sbbTimeline.Selected = true; m_sbbSelected = sbbTimeline; m_sbeSelected = SidebarButtonEnum.Timeline; SidebarChanged(); }
private void load() { InternalChild = ContentContainer = new Container { Width = WIDTH, RelativeSizeAxes = Axes.Y, Children = new Drawable[] { Background = new Box { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Scale = new Vector2(2, 1), // over-extend to the left for transitions RelativeSizeAxes = Axes.Both, Colour = Color4.Black, Alpha = 0.6f, }, SectionsContainer = new SettingsSectionsContainer { Masking = true, RelativeSizeAxes = Axes.Both, ExpandableHeader = CreateHeader(), FixedHeader = searchTextBox = new SearchTextBox { RelativeSizeAxes = Axes.X, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, Width = 0.95f, Margin = new MarginPadding { Top = 20, Bottom = 20 }, Exit = Hide, }, Footer = CreateFooter() }, } }; if (showSidebar) { AddInternal(Sidebar = new Sidebar { Width = sidebar_width }); SectionsContainer.SelectedSection.ValueChanged += section => { selectedSidebarButton.Selected = false; selectedSidebarButton = Sidebar.Children.Single(b => b.Section == section.NewValue); selectedSidebarButton.Selected = true; }; } searchTextBox.Current.ValueChanged += term => SectionsContainer.SearchContainer.SearchTerm = term.NewValue; CreateSections()?.ForEach(AddSection); }
private void sbbLists_Click(object sender, EventArgs e) { MessageBox.Show("Sorry! Lists haven't been implemented yet. Contribute to this project on Github (http://github.com/camertron/twitter-windows) and scrach your itch!", "Feature Not Implemented", MessageBoxButtons.OK, MessageBoxIcon.Information); return; m_sbbSelected.Selected = false; sbbLists.Selected = true; m_sbbSelected = sbbLists; SidebarChanged(); }
// MENU BUTTONS private void DisplayContainer(Control container, SidebarButton button) { ScriptContainer.Visible = false; OverviewContainer.Visible = false; SettingsContainer.Visible = false; ActionsContainer.Visible = false; EfficiencyContainer.Visible = false; container.Visible = true; sbbOverview.Active = false; sbbScripts.Active = false; sbbSettings.Active = false; sbbActions.Active = false; sbbEfficiency.Active = false; button.Active = true; }
public FrmMain() { InitializeComponent(); //IsolatedStorageManager.GetManager().Store.DeleteFile(Literals.C_ACCOUNT_FILE); //assignments m_sbbSelected = sbbTimeline; //object creation m_ftTweetForm = new FrmTweet(this); m_fpPrefForm = new FrmPreferences(); //timeline event hookups tmlTimeline.StatusTextClicked += new Timeline.StatusTextClickedHandler(tmlTimeline_StatusTextClicked); tmlTimeline.RetweetClicked += new Timeline.StatusOptionClickedHandler(tmlTimeline_RetweetClicked); tmlTimeline.FavoriteClicked += new Timeline.StatusOptionClickedHandler(tmlTimeline_FavoriteClicked); tmlTimeline.QuoteTweetClicked += new Timeline.StatusOptionClickedHandler(tmlTimeline_QuoteTweetClicked); tmlTimeline.ReplyClicked += new Timeline.StatusOptionClickedHandler(tmlTimeline_ReplyClicked); //preference form event hookups m_fpPrefForm.CredentialsAdded += new FrmAddAccount.OAuthDanceHandler(m_fpPrefForm_CredentialsAdded); m_fpPrefForm.CredentialsRemoved += new FrmPreferences.CredentialsRemovedHandler(m_fpPrefForm_CredentialsRemoved); m_fpPrefForm.AccountList = TwitterController.GetController().Accounts; //form event hookups m_ftTweetForm.TweetClicked += new FrmTweet.TweetClickedEventHandler(m_ftTweetForm_TweetClicked); tsbTimelineScroller.Scroll += new ScrollEventHandler(tsbTimelineScroller_Scroll); tmlTimeline.ScrolledToTop = true; if (m_twController.Accounts.Count == 0) { tmlTimeline.DisableLoadingAnimation(); } //@TODO: do this for testing purposes only if (Literals.C_ENVIRONMENT == Env.Development) { UserTimeline utLine = new UserTimeline(JsonParser.GetParser().ParseFile("../../../../Documents/test/tweets/tweets2.json").Root.ToList()); for (int i = 0; i < utLine.Statuses.Count; i++) { Account_UserStream_Receive(this, new JsonDocument(utLine.Statuses[i].Object), API.Streaming.UserStream.ReceiveType.Tweet); } } }
private void loadSidebarButtons() { if (Sidebar == null) { return; } LoadComponentsAsync(createSidebarButtons(), buttons => { float delay = 0; foreach (var button in buttons) { Sidebar.Add(button); button.FadeOut() .Delay(delay) .FadeInFromZero(fade_in_duration, Easing.OutQuint); delay += 40; } SectionsContainer.SelectedSection.BindValueChanged(section => { if (selectedSidebarButton != null) { selectedSidebarButton.Selected = false; } selectedSidebarButton = Sidebar.Children.FirstOrDefault(b => b.Section == section.NewValue); if (selectedSidebarButton != null) { selectedSidebarButton.Selected = true; } }, true); }); }
private void load(OsuGame game) { var sections = new SettingsSection[] { new GeneralSection(), new GraphicsSection(), new GameplaySection(), new AudioSection(), new SkinSection(), new InputSection(), new OnlineSection(), new MaintenanceSection(), new DebugSection(), }; Children = new Drawable[] { new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, Alpha = 0.6f, }, sectionsContainer = new SettingsSectionsContainer { RelativeSizeAxes = Axes.Y, Width = width, Margin = new MarginPadding { Left = SIDEBAR_WIDTH }, ExpandableHeader = new SettingsHeader(), FixedHeader = searchTextBox = new SearchTextBox { RelativeSizeAxes = Axes.X, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, Width = 0.95f, Margin = new MarginPadding { Top = 20, Bottom = 20 }, Exit = Hide, }, Sections = sections, Footer = new SettingsFooter() }, sidebar = new Sidebar { Width = SIDEBAR_WIDTH, Children = sidebarButtons = sections.Select(section => new SidebarButton { Section = section, Action = sectionsContainer.ScrollContainer.ScrollIntoView, } ).ToArray() } }; selectedSidebarButton = sidebarButtons[0]; selectedSidebarButton.Selected = true; sectionsContainer.SelectedSection.ValueChanged += section => { selectedSidebarButton.Selected = false; selectedSidebarButton = sidebarButtons.Single(b => b.Section == section); selectedSidebarButton.Selected = true; }; searchTextBox.Current.ValueChanged += newValue => sectionsContainer.SearchContainer.SearchTerm = newValue; sectionsContainer.Padding = new MarginPadding { Top = game?.Toolbar.DrawHeight ?? 0 }; }