Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: External Method Buttons #6

Open
max-sun-hongyi opened this issue Aug 5, 2020 · 0 comments
Open

Enhancement: External Method Buttons #6

max-sun-hongyi opened this issue Aug 5, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@max-sun-hongyi
Copy link

This enhancement allows user to click on different buttons to post different external methods. In my personal opinion buttons are more intuitive to use than checkbox + single button. I totally understand the current setup is for demo purpose and it's useful. This enhancement is to provide users with an additional way to post external methods.

image

I've added 3 buttons in the "Export" tab

                <Button x:Name="BExternalMethodProject" BorderBrush="#FFABADB3" Background="{x:Null}" Padding="5,0,5,0"
                        Click="BExternalMethodProject_Click" HorizontalAlignment="Left" Width="183" Height="26"
                        VerticalAlignment="Top" Margin="11,40,0,0" Grid.ColumnSpan="2" Grid.Row="1">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Project" Margin="5,0,0,0" />
                    </StackPanel>
                </Button>
                
                <Button x:Name="BExternalMethodWalls" BorderBrush="#FFABADB3" Background="{x:Null}" Padding="5,0,5,0"
                        Click="BExternalMethodWalls_Click" HorizontalAlignment="Left" Width="183" Height="26"
                        VerticalAlignment="Center" Margin="11,40,0,0" Grid.ColumnSpan="2" Grid.Row="1">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Walls" Margin="5,0,0,0" />
                    </StackPanel>
                </Button>
                <Button x:Name="BExternalMethodSheet" BorderBrush="#FFABADB3" Background="{x:Null}" Padding="5,0,5,0"
                        Click="BExternalMethodSheet_Click" HorizontalAlignment="Left" Width="183" Height="26"
                        VerticalAlignment="Bottom" Margin="11,40,0,0" Grid.ColumnSpan="2" Grid.Row="1">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Sheet" Margin="5,0,0,0" />
                    </StackPanel>
                </Button>

Then I've utilized the "IsMouseOver" property in the MethodsWrapper class to identify which button is clicked. (Open for suggestions and better ideas)

        if (ui.BExternalMethodProject.IsMouseOver)
        {
            Methods.DocumentInfo(ui, doc);
        }

        if (ui.BExternalMethodWalls.IsMouseOver)
        {
            Methods.WallInfo(ui, doc);
        }

        if (ui.BExternalMethodSheet.IsMouseOver)
        {
            Methods.SheetRename(ui, doc);
        }

Happy to create a pull request if you find this enhancement useful.

Thanks very much for sharing your template and make it open source!

@max-sun-hongyi max-sun-hongyi changed the title Enhancement: External Method Buttons ( Enhancement: External Method Buttons Aug 5, 2020
@mitevpi mitevpi added the enhancement New feature or request label Aug 5, 2020
@mitevpi mitevpi self-assigned this Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants