Skip to content

Commit

Permalink
fix a weird definition (union) of Rectangle struct
Browse files Browse the repository at this point in the history
  • Loading branch information
duchuule committed Aug 3, 2015
1 parent 60155e8 commit ddab483
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 23 deletions.
21 changes: 16 additions & 5 deletions ImportPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,17 @@
Text="Use this option to import a file already present on your phone or PC. Note: due to a bug in Windows 10, you won't be able to see the content of the folder you are browsing. Just select the folder containing the rom and will be presented with a list of rom to import."
Margin=" 0, 4, 0, 4" />

<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal"
Margin="0,4,0,4">
<Button x:Name="chooseFolderbtn" Content="Import ROM"
Click="chooseFolderbtn_Click"
Width="120"
Margin =" 0, 4, 8, 4"/>
Margin =" 0, 0, 8, 0"/>

<Button x:Name="importSavbtn" Content="Import Save"
Width="120"
Margin =" 0, 4, 0, 4"
Margin ="0"
Click="importSavbtn_Click"/>


</StackPanel>

<TextBlock Text="OneDrive"
Expand All @@ -78,6 +77,18 @@
Style="{ThemeResource CaptionTextBlockStyle}"
Visibility="Collapsed"
/>
<StackPanel Orientation="Horizontal"
Margin="0,4,0,4">
<Button x:Name="importOneDriveROMbtn" Content="Import ROM"
Click="importOneDriveROMbtn_Click"
Width="120"
Margin =" 0, 0, 8, 0"/>

<Button x:Name="importOneDriveSavebtn" Content="Import Save"
Width="120"
Margin ="0"
Click="importSavbtn_Click"/>
</StackPanel>
<!--<TextBlock TextWrapping="Wrap"
Text="This function will be added in a future release. In the mean time, please store roms on your phone's SD Card or documents folder and use the Local Storage option."
Margin=" 0, 4, 0, 4" />-->
Expand Down
11 changes: 7 additions & 4 deletions ImportPage.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,7 @@ void ImportPage::importSavbtn_Click(Platform::Object^ sender, Windows::UI::Xaml:
}


void ImportPage::OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
{

}


void ImportPage::Page_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
Expand Down Expand Up @@ -308,3 +305,9 @@ void ImportPage::SignInbtn_Click(Platform::Object^ sender, Windows::UI::Xaml::Ro

});
}


void ImportPage::importOneDriveROMbtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{

}
4 changes: 2 additions & 2 deletions ImportPage.xaml.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ namespace VBA10
ImportPage();
void ImportFile(StorageFile^ file);

protected:
virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;


private:
void chooseFolderbtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
Expand All @@ -31,5 +30,6 @@ namespace VBA10
void importSavbtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void Page_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void SignInbtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void importOneDriveROMbtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
};
}
4 changes: 2 additions & 2 deletions Rectangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ namespace Engine
: TopLeft(topleft), Size(size), X(topleft.X), Y(topleft.Y), Width(size.Width), Height(size.Height)
{ }

Rectangle::~Rectangle()
{ }
//Rectangle::~Rectangle()
//{ }

Point Rectangle::GetBottomRight(void) const
{
Expand Down
20 changes: 10 additions & 10 deletions Rectangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ namespace Engine
struct Rectangle
{
public:
union
{
struct
{
//union
//{
// struct
// {
int X;
int Y;
unsigned int Width;
unsigned int Height;
};
struct
{
//};
//struct
//{
Point TopLeft;
Size Size;
};
};
// };
//};

Rectangle();
Rectangle(int x, int y, unsigned int width, unsigned int height);
Rectangle(const Point &topleft, const Engine::Size &size);

~Rectangle();
~Rectangle() = default;

Point GetBottomRight(void) const;
void GetBottomRight(Point *p) const;
Expand Down

0 comments on commit ddab483

Please sign in to comment.