public EditingView(EditingModel model, PageListView pageListView,
CutCommand cutCommand, CopyCommand copyCommand, PasteCommand pasteCommand, UndoCommand undoCommand,
DuplicatePageCommand duplicatePageCommand,
DeletePageCommand deletePageCommand, NavigationIsolator isolator, ControlKeyEvent controlKeyEvent)
{
_model = model;
_pageListView = pageListView;
_cutCommand = cutCommand;
_copyCommand = copyCommand;
_pasteCommand = pasteCommand;
_undoCommand = undoCommand;
_duplicatePageCommand = duplicatePageCommand;
_deletePageCommand = deletePageCommand;
InitializeComponent();
_browser1.Isolator = isolator;
_splitContainer1.Tag = _splitContainer1.SplitterDistance; //save it
//don't let it grow automatically
// _splitContainer1.SplitterMoved+= ((object sender, SplitterEventArgs e) => _splitContainer1.SplitterDistance = (int)_splitContainer1.Tag);
SetupThumnailLists();
_model.SetView(this);
_browser1.SetEditingCommands(cutCommand, copyCommand, pasteCommand, undoCommand);
_browser1.GeckoReady += new EventHandler(OnGeckoReady);
_browser1.ControlKeyEvent = controlKeyEvent;
if(SIL.PlatformUtilities.Platform.IsMono)
{
RepositionButtonsForMono();
BackgroundColorsForLinux();
}
controlKeyEvent.Subscribe(HandleControlKeyEvent);
// Adding this renderer prevents a white line from showing up under the components.
_menusToolStrip.Renderer = new FixedToolStripRenderer();
//we're giving it to the parent control through the TopBarControls property
Controls.Remove(_topBarPanel);
SetupBrowserContextMenu();
#if __MonoCS__
// The inactive button images look garishly pink on Linux/Mono, but look okay on Windows.
// Merely introducing an "identity color matrix" to the image attributes appears to fix
// this problem. (The active form looks okay with or without this fix.)
// See http://issues.bloomlibrary.org/youtrack/issue/BL-3714.
float[][] colorMatrixElements = {
new float[] {1, 0, 0, 0, 0}, // red scaling factor of 1
new float[] {0, 1, 0, 0, 0}, // green scaling factor of 1
new float[] {0, 0, 1, 0, 0}, // blue scaling factor of 1
new float[] {0, 0, 0, 1, 0}, // alpha scaling factor of 1
new float[] {0, 0, 0, 0, 1}}; // three translations of 0.0
var colorMatrix = new ColorMatrix(colorMatrixElements);
_duplicatePageButton.ImageAttributes.SetColorMatrix(colorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
_deletePageButton.ImageAttributes.SetColorMatrix(colorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
_undoButton.ImageAttributes.SetColorMatrix(colorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
_cutButton.ImageAttributes.SetColorMatrix(colorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
_pasteButton.ImageAttributes.SetColorMatrix(colorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
_copyButton.ImageAttributes.SetColorMatrix(colorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
#endif
}