Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
raster properties row formatting issue #232
- Loading branch information
1 parent
c733c41
commit db0d44f
Showing
9 changed files
with
184 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
using GCDCore.Project; | ||
using System; | ||
|
||
namespace GCDCore.UserInterface | ||
{ | ||
/// <summary> | ||
/// Class to manage the items put in a DataGridView that simply need a property and value pair. | ||
/// </summary> | ||
/// <remarks> | ||
/// Header items have no value string and these are displayed in bold. Items with a value string | ||
/// are indented by the software left indent setting</remarks> | ||
public class GridViewPropertyValueItem | ||
{ | ||
public string Property { get; protected set; } | ||
public string Value { get; protected set; } | ||
public readonly bool Header; | ||
|
||
// Non-header cells are indented | ||
public int LeftPadding { get { return Header ? 0 : GCDCore.Properties.Settings.Default.PropertyGridLeftIndent; } } | ||
|
||
/// <summary> | ||
/// Default constructor required for grid binding | ||
/// </summary> | ||
public GridViewPropertyValueItem() | ||
{ | ||
|
||
} | ||
|
||
/// <summary> | ||
/// Constructor for regular NON-HEADER items | ||
/// </summary> | ||
/// <param name="prop"></param> | ||
/// <param name="value"></param> | ||
public GridViewPropertyValueItem(string prop, string value) | ||
{ | ||
Property = prop; | ||
Value = value; | ||
Header = false; | ||
} | ||
|
||
/// <summary> | ||
/// Constructor for headers only | ||
/// </summary> | ||
/// <param name="header"></param> | ||
public GridViewPropertyValueItem(string header) | ||
{ | ||
Property = header; | ||
Value = string.Empty; | ||
Header = true; | ||
} | ||
} | ||
|
||
public class GridViewGCDProjectItem : GridViewPropertyValueItem | ||
{ | ||
public readonly GCDProjectItem ProjectItem; | ||
|
||
public GridViewGCDProjectItem(string prop, string value, GCDProjectItem item) | ||
: base(prop, value) | ||
{ | ||
ProjectItem = item; | ||
} | ||
|
||
public GridViewGCDProjectItem(string prop, GCDProjectItem item) | ||
: base(prop, string.Empty) | ||
{ | ||
if (item is GCDProjectRasterItem) | ||
Value = ProjectManager.Project.GetRelativePath(((GCDProjectRasterItem)item).Raster.GISFileInfo); | ||
else if (item is GCDProjectVectorItem) | ||
Value = ProjectManager.Project.GetRelativePath(((GCDProjectVectorItem)item).Vector.GISFileInfo); | ||
} | ||
} | ||
|
||
public class GridViewRasterItem : GridViewPropertyValueItem | ||
{ | ||
public readonly GCDConsoleLib.Raster Raster; | ||
|
||
public GridViewRasterItem(string prop, string value, GCDConsoleLib.Raster raster) | ||
: base(prop, value) | ||
{ | ||
Raster = raster; | ||
} | ||
|
||
public GridViewRasterItem(string prop, GCDConsoleLib.Raster raster) | ||
: base(prop, string.Empty) | ||
{ | ||
Raster = raster; | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
GCDCore/UserInterface/SurveyLibrary/frmSurfaceProperties.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.