Skip to content

Commit

Permalink
Control size issue (#2064)
Browse files Browse the repository at this point in the history
* Some work on control size issue

* wOrk on control size issue

* work on some control size issue

* Update Splasch screen

* Update Splasch screen
  • Loading branch information
msevestre authored Jan 21, 2022
1 parent c711d47 commit 2870435
Show file tree
Hide file tree
Showing 17 changed files with 814 additions and 441 deletions.
2 changes: 1 addition & 1 deletion src/PKSim.Core/CoreConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ public static class UI
public const int SIMULATION_SETTINGS_HEIGHT = 650;
public const int SIMULATION_VIEW_WIDTH = 700;
public const int INDIVIDUAL_VIEW_WIDTH = 880;
public const int INDIVIDUAL_VIEW_HEIGHT = 720;
public const int INDIVIDUAL_VIEW_HEIGHT = 780;
public const int CONFIGURE_SIMULATION_VIEW_HEIGHT = 708;
public const int CREATE_SIMULATION_VIEW_HEIGHT = CONFIGURE_SIMULATION_VIEW_HEIGHT + 40;

Expand Down
41 changes: 41 additions & 0 deletions src/PKSim.UI/Extensions/TablePanelExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System.Drawing;
using System.Windows.Forms;
using DevExpress.Utils.Layout;
using DevExpress.XtraEditors;
using OSPSuite.UI;
using OSPSuite.Utility.Extensions;

namespace PKSim.UI.Extensions
{
public static class TablePanelExtensions
{
public static TablePanel WithAbsoluteWidth(this TablePanel tablePanel, int columnIndex0, int width)
{
tablePanel.Columns[columnIndex0].Style = TablePanelEntityStyle.Absolute;
tablePanel.Columns[columnIndex0].Width = width;
return tablePanel;
}

public static TablePanel WithLongButtonWidth(this TablePanel tablePanel, params int[] columnIndexes)
{
//TODO define constant
columnIndexes.Each(columnIndex => WithAbsoluteWidth(tablePanel, columnIndex, 150));
return tablePanel;
}

public static TablePanel WithButtonWidth(this TablePanel tablePanel, params int[] columnIndexes)
{
columnIndexes.Each(columnIndex => WithAbsoluteWidth(tablePanel, columnIndex, 30));
return tablePanel;
}

public static void AdjustButtonWithImageOnly(this SimpleButton button)
{
button.Size = new Size(UIConstants.Size.ScaleForScreenDPI(24), UIConstants.Size.ScaleForScreenDPI(22));
}
public static void AdjustLongButtonWidth(this SimpleButton button)
{
button.Size = new Size(UIConstants.Size.LARGE_BUTTON_WIDTH, button.Height);
}
}
}
162 changes: 75 additions & 87 deletions src/PKSim.UI/Views/BuildingBlockSelectionView.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions src/PKSim.UI/Views/BuildingBlockSelectionView.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using DevExpress.Utils;
using DevExpress.XtraEditors;
using OSPSuite.Assets;
using OSPSuite.DataBinding;
using OSPSuite.DataBinding.DevExpress;
using OSPSuite.UI.Services;
using OSPSuite.UI;
using OSPSuite.UI.Controls;
using OSPSuite.UI.Extensions;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using OSPSuite.UI.Services;
using PKSim.Assets;
using PKSim.Presentation.DTO;
using PKSim.Presentation.Presenters;
using PKSim.Presentation.Views;
using OSPSuite.Assets;
using OSPSuite.UI.Controls;

namespace PKSim.UI.Views
{
Expand Down Expand Up @@ -104,8 +105,10 @@ private void initializeResource()
{
btnCreateBuildingBlock.InitWithImage(ApplicationIcons.Create, imageLocation: ImageLocation.MiddleCenter);
btnLoadBuildingBlock.InitWithImage(ApplicationIcons.LoadFromTemplate, imageLocation: ImageLocation.MiddleCenter);
layoutItemCreate.AdjustButtonSizeWithImageOnly();
layoutItemLoad.AdjustButtonSizeWithImageOnly();
layoutItemCreate.AdjustButtonSizeWithImageOnly();
//Make combo box same size as button
layoutItemBuildingBlock.AdjustSize(0, UIConstants.Size.BUTTON_HEIGHT);
cbBuildingBlocks.Properties.AllowHtmlDraw = DefaultBoolean.True;
}
}
Expand Down
Loading

0 comments on commit 2870435

Please sign in to comment.