<Folder Include="src\" />
<Folder Include="images\" />
<Folder Include="src\SourceEditor\" />
+ <Folder Include="ui\ItemTemplates\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="images\save.svg" />
<EmbeddedResource Include="ui\SrcEdit.itemp" />
<EmbeddedResource Include="ui\IcoBut.template" />
<EmbeddedResource Include="ui\MembersItem.template" />
+ <EmbeddedResource Include="ui\ItemTemplates\Enum.template" />
+ <EmbeddedResource Include="ui\ItemTemplates\Fill.template" />
</ItemGroup>
<ItemGroup>
<None Include="ui\test.crow">
Instantiator instFileDlg;
Solution currentSolution;
+ public static Interface MainIFace;
+
protected override void OnLoad (EventArgs e)
{
base.OnLoad (e);
- instFileDlg = Instantiator.CreateFromImlFragment
- (CurrentInterface, "<FileDialog Caption='Open File' CurrentDirectory='{²CurrentDirectory}' SearchPattern='*.sln' OkClicked='onFileOpen'/>");
-
initCommands ();
this.KeyDown += CrowIDE_KeyDown;
//this.CrowInterface.LoadInterface ("#Crow.Coding.ui.imlEditor.crow").DataSource = this;
//GraphicObject go = this.CrowInterface.LoadInterface (@"ui/test.crow");
GraphicObject go = AddWidget (@"#Crow.Coding.ui.CrowIDE.crow");
+
+ MainIFace = ifaceControl[0].CrowInterface;
+
if (ReopenLastSolution && !string.IsNullOrEmpty(LastOpenSolution))
CurrentSolution = Solution.LoadSolution (LastOpenSolution);
go.DataSource = this;
+ instFileDlg = Instantiator.CreateFromImlFragment
+ (MainIFace, "<FileDialog Caption='Open File' CurrentDirectory='{²CurrentDirectory}' SearchPattern='*.sln' OkClicked='onFileOpen'/>");
}
void loadProjProps () {
}
void loadWindow(string path, object dataSource = null){
try {
- GraphicObject g = CurrentInterface.FindByName (path);
+ GraphicObject g = MainIFace.FindByName (path);
if (g != null)
return;
- g = CurrentInterface.AddWidget (path);
+ g = MainIFace.AddWidget (path);
g.Name = path;
g.DataSource = dataSource;
} catch (Exception ex) {
}
}
void closeWindow (string path){
- GraphicObject g = CurrentInterface.FindByName (path);
+ GraphicObject g = MainIFace.FindByName (path);
if (g != null)
- CurrentInterface.DeleteWidget (g);
+ MainIFace.DeleteWidget (g);
}
protected void onCommandSave(object sender, MouseButtonEventArgs e){
: base (pi.Project, pi.node) {
cmdSave = new Crow.Command (new Action (() => Save ()))
- { Caption = "Save", Icon = new SvgPicture ("#Crow.Coding.ui.icons.inbox.svg"), CanExecute = false };
+ { Caption = "Save", Icon = new SvgPicture ("#Crow.Coding.ui.icons.inbox.svg"), CanExecute = true };
cmdOpen = new Crow.Command (new Action (() => Open ()))
{ Caption = "Open", Icon = new SvgPicture ("#Crow.Coding.ui.icons.outbox.svg"), CanExecute = false };
origSource = source;
NotifyValueChanged ("IsDirty", false);
}
+ public void Close () {
+ origSource = null;
+ isOpened = false;
+ Project.solution.CloseItem (this);
+ }
public void OnQueryClose (object sender, EventArgs e){
- if (IsDirty)
- Console.WriteLine ("closing unsaved file");
- Project.solution.CloseItem (this);
+ if (IsDirty) {
+ MessageBox mb = MessageBox.ShowModal (CrowIDE.MainIFace,
+ MessageBox.Type.YesNoCancel, $"{DisplayName} has unsaved changes.\nSave it now?");
+ mb.Yes += onClickSaveAndCloseNow;
+ mb.No += onClickCloseNow;
+ } else
+ Close ();
+ }
+
+ void onClickCloseNow (object sender, EventArgs e)
+ {
+ Close ();
+ }
+
+ void onClickSaveAndCloseNow (object sender, EventArgs e)
+ {
+ Save ();
+ Close ();
}
}
public class ImlProjectItem : ProjectFile
public object[] Choices {
get {
- return Enum.GetValues (pi.PropertyType).Cast<object>().ToArray();
+ return pi.PropertyType.IsEnum ?
+ Enum.GetValues (pi.PropertyType).Cast<object>().ToArray() :
+ mview.ProjectNode.Project.solution.AvailaibleStyles;
}
}
if (StartupProject != null)
StartupProject.GetStyling ();
}
-
+ public string[] AvailaibleStyles {
+ get { return Styling == null ? new string[] {} : Styling.Keys.ToArray();}
+ }
public void ReloadDefaultTemplates () {
DefaultTemplates = new Dictionary<string, string>();
if (StartupProject != null)
BlockCommentStart = 4,
BlockComment = 5,
BlockCommentEnd = 6,
- Type = 7,
+ Preprocessor = 7,
Identifier = 8,
- Indexer = 9,
+ Keyword = 9,
OpenBlock = 10,
CloseBlock = 11,
StatementEnding = 12,
- UnaryOp = 13,
- BinaryOp = 14,
- Affectation = 15,
+ OperatorOrPunctuation = 13,
+ IntegerLitteral = 14,
+ RealLitteral = 15,
StringLitteralOpening = 16,
StringLitteralClosing = 17,
StringLitteral = 18,
- NumericLitteral = 19,
- Preprocessor = 20,
- Keyword = 21,
+ CharLitteralOpening = 19,
+ CharLitteralClosing = 20,
+ CharLitteral = 21,
+ BoolLitteral = 22,
+ NullLitteral = 23,
+ Type = 24,
}
#region CTOR
void Buffer_LineUpadateEvent (object sender, CodeBufferEventArgs e)
{
for (int i = 0; i < e.LineCount; i++)
- tryParseBufferLine (e.LineStart + i);
+ TryParseBufferLine (e.LineStart + i);
reparseSource ();
}
#endregion
+ internal int currentLine = 0;
+ internal int currentColumn = 0;
+
+ protected CodeBuffer buffer;
+ protected Token currentTok;
+ protected bool eol = true;
+ protected Point CurrentPosition {
+ get { return new Point (currentLine, currentColumn); }
+ set {
+ currentLine = value.Y;
+ currentColumn = value.X;
+ }
+ }
+
+ public Node RootNode;
+
+ public abstract void ParseCurrentLine();
+ public abstract void SyntaxAnalysis ();
+ public void reparseSource () {
+ for (int i = 0; i < buffer.LineCount; i++) {
+ if (!buffer[i].IsParsed)
+ TryParseBufferLine (i);
+ }
+ try {
+ SyntaxAnalysis ();
+ } catch (Exception ex) {
+ Debug.WriteLine ("Syntax Error: " + ex.ToString ());
+ if (ex is ParserException)
+ SetLineInError (ex as ParserException);
+ }
+ }
+ public void TryParseBufferLine(int lPtr) {
+ buffer [lPtr].exception = null;
+ currentLine = lPtr;
+ currentColumn = 0;
+ eol = false;
+
+ try {
+ ParseCurrentLine ();
+ } catch (Exception ex) {
+ Debug.WriteLine (ex.ToString ());
+ if (ex is ParserException)
+ SetLineInError (ex as ParserException);
+ }
+
+ }
+
+ public virtual void SetLineInError(ParserException ex) {
+ currentTok = default(Token);
+ if (ex.Line >= buffer.LineCount)
+ ex.Line = buffer.LineCount - 1;
+ if (buffer [ex.Line].IsFolded)
+ buffer.ToogleFolding (ex.Line);
+ buffer [ex.Line].SetLineInError (ex);
+ }
+ public virtual string LineBrkRegex {
+ get { return @"\r\n|\r|\n|\\\\n"; }
+ }
void updateFolding () {
// Stack<TokenList> foldings = new Stack<TokenList>();
// bool inStartTag = false;
// }
// }
}
- public void reparseSource () {
- for (int i = 0; i < buffer.LineCount; i++) {
- if (!buffer[i].IsParsed)
- tryParseBufferLine (i);
- }
- try {
- SyntaxAnalysis ();
- } catch (Exception ex) {
- Debug.WriteLine ("Syntax Error: " + ex.ToString ());
- if (ex is ParserException)
- SetLineInError (ex as ParserException);
- }
- }
- public void tryParseBufferLine(int lPtr) {
- buffer [lPtr].exception = null;
- currentLine = lPtr;
- currentColumn = 0;
- eol = false;
-
- try {
- ParseCurrentLine ();
- } catch (Exception ex) {
- Debug.WriteLine (ex.ToString ());
- if (ex is ParserException)
- SetLineInError (ex as ParserException);
- }
-
- }
-
- protected CodeBuffer buffer;
-
- internal int currentLine = 0;
- internal int currentColumn = 0;
- protected Token currentTok;
- protected bool eol = true;
-
- public Node RootNode;
-
- protected Point CurrentPosition {
- get { return new Point (currentLine, currentColumn); }
- set {
- currentLine = value.Y;
- currentColumn = value.X;
- }
- }
-
- public abstract void ParseCurrentLine();
- public abstract void SyntaxAnalysis ();
-
- public virtual void SetLineInError(ParserException ex) {
- currentTok = default(Token);
- if (ex.Line >= buffer.LineCount)
- ex.Line = buffer.LineCount - 1;
- if (buffer [ex.Line].IsFolded)
- buffer.ToogleFolding (ex.Line);
- buffer [ex.Line].SetLineInError (ex);
- }
#region low level parsing
/// <summary>
currentTok.Type = (TokenType)type;
saveAndResetCurrentTok ();
}
+ protected void setPreviousTokOfTypeTo (TokenType inType, TokenType newType) {
+ for (int i = currentLine; i >= 0; i--) {
+ int j = buffer [i].Tokens.Count - 1;
+ while (j >= 0) {
+ if (buffer [i].Tokens [j].Type == inType) {
+ Token t = buffer [i].Tokens [j];
+ t.Type = newType;
+ buffer [i].Tokens [j] = t;
+ return;
+ }
+ j--;
+ }
+ }
+ }
/// <summary>
/// Peek next char, emit '\n' if current column > buffer's line length
/// Throw error if eof is true
}
#region Regular Expression for validity checks
- private static Regex rxValidChar = new Regex(@"\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}|\p{Nl}|\p{Mn}|\p{Mc}|\p{Nd}|\p{Pc}|\p{Cf}");
- private static Regex rxNameStartChar = new Regex(@"_|\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}");
- private static Regex rxNameChar = new Regex(@"\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}|\p{Nl}|\p{Mn}|\p{Mc}|\p{Nd}|\p{Pc}|\p{Cf}");
- private static Regex rxDecimal = new Regex(@"[0-9]+");
- private static Regex rxHexadecimal = new Regex(@"[0-9a-fA-F]+");
- #endregion
+ static Regex rxValidChar = new Regex(@"\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}|\p{Nl}|\p{Mn}|\p{Mc}|\p{Nd}|\p{Pc}|\p{Cf}");
+ static Regex rxNameStartChar = new Regex(@"_|\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}|\p{Nl}");
+ static Regex rxNameChar = new Regex(@"\p{Lu}|\p{Ll}|\p{Lt}|\p{Lm}|\p{Lo}|\p{Nl}|\p{Mn}|\p{Mc}|\p{Nd}|\p{Pc}|\p{Cf}");
+ static Regex rxNewLineChar = new Regex(@"\u000D|\u000A|\u0085|\u2028|\u2029");
+ static Regex rxWhiteSpaceChar = new Regex(@"\p{Zs}|\u0009|\u000B|\u000C");
+ static Regex rxDecimal = new Regex(@"[0-9]+");
+ static Regex rxHexadecimal = new Regex(@"[0-9a-fA-F]+");
- #region Character ValidityCheck
public bool nextCharIsValidCharStartName
{
get { return rxNameStartChar.IsMatch(new string(new char[]{Peek()})); }
cl.EndingState = (int)curState;
}
+
+ Node addChildNode (Node curNode, CodeLine cl, int tokPtr) {
+ Node n = new Node () { Name = cl.Tokens [tokPtr].Content, StartLine = cl };
+ curNode.AddChild (n);
+ if (cl.SyntacticNode == null)
+ cl.SyntacticNode = n;
+ return n;
+ }
+ void closeNodeAndGoUp (ref Node n, CodeLine cl){
+ if (n.StartLine == cl){//prevent single line node
+ n.Parent.Children.Remove (n);
+ if (cl.SyntacticNode == n)
+ cl.SyntacticNode = null;
+ }else
+ n.EndLine = cl;
+ n = n.Parent;
+ }
+
public override void SyntaxAnalysis ()
{
RootNode = new Node () { Name = "RootNode", Type="Root" };
+
+ Node currentNode = RootNode;
+
+ int ptrLine = 0;
+ while (ptrLine < buffer.LineCount) {
+ CodeLine cl = buffer [ptrLine];
+ if (cl.Tokens == null){
+ ptrLine++;
+ continue;
+ }
+ cl.SyntacticNode = null;
+
+ int tokPtr = 0;
+ bool onlyWhiteSpace = true;
+ while (tokPtr < cl.Tokens.Count) {
+ if (cl.Tokens [tokPtr].Type == TokenType.WhiteSpace) {
+ tokPtr++;
+ continue;
+ }
+
+ if (cl.Tokens [tokPtr].Type == TokenType.LineComment && onlyWhiteSpace) {
+ currentNode = addChildNode (currentNode, cl, tokPtr);
+ ptrLine++;
+ while (ptrLine < buffer.LineCount) {
+ int idx = buffer [ptrLine].FirstNonBlankTokIndex;
+ if (idx < 0)
+ break;
+ if (buffer [ptrLine].Tokens [idx].Type != TokenType.LineComment)
+ break;
+ ptrLine++;
+ }
+ closeNodeAndGoUp (ref currentNode, buffer [ptrLine]);
+ break;
+ }
+
+ switch (cl.Tokens [tokPtr].Type) {
+ case TokenType.OpenBlock:
+ currentNode = addChildNode (currentNode, cl, tokPtr);
+ break;
+ case TokenType.CloseBlock:
+ closeNodeAndGoUp (ref currentNode, cl);
+ break;
+ }
+ onlyWhiteSpace = false;
+ tokPtr++;
+ }
+ ptrLine++;
+ }
}
}
}
public event EventHandler PositionChanged;
#endregion
- #region CTOR
- public CodeBuffer () {
-
- }
- #endregion
-
string lineBreak = Interface.LineBreak;
List<CodeLine> lines = new List<CodeLine>();
public int longestLineIdx = 0;
FoldingEvent.Raise (this, new CodeBufferEventArgs (line));
}
}
- public void Load(string rawSource) {
+ public void Load(string rawSource, string lineBrkRegex = @"\r\n|\r|\n|\\\n") {
this.Clear();
if (string.IsNullOrEmpty (rawSource))
return;
- AddRange (Regex.Split (rawSource, "\r\n|\r|\n|\\\\n"));
+ AddRange (Regex.Split (rawSource, lineBrkRegex));
lineBreak = detectLineBreakKind (rawSource);
}
public int GetEndNodeIndex (int line) {
return IndexOf (this [line].SyntacticNode.EndLine);
}
+
+ int ConverteTabulatedPosOfCurLine (int column) {
+ int tmp = 0;
+ int i = 0;
+ while (i < lines [_currentLine].Content.Length){
+ if (lines [_currentLine].Content [i] == '\t')
+ tmp += 4;
+ else
+ tmp++;
+ if (tmp > column)
+ break;
+ i++;
+ }
+ return i;
+ }
+
+ int CurrentTabulatedColumn {
+ get {
+ return lines [_currentLine].Content.Substring (0, _currentCol).
+ Replace ("\t", new String (' ', Interface.TabSize)).Length;
+ }
+ }
/// <summary>
/// Gets visual position computed from actual buffer position
/// </summary>
}
public bool SelectionIsEmpty
{ get { return selEndPos == selStartPos; } }
+ int requestedColumn = -1;
/// <summary>
/// Current column in buffer coordinate, tabulation = 1 char
/// </summary>
return;
if (value < 0)
_currentCol = 0;
- else if (value > lines [_currentLine].Length)
+ else if (value > lines [_currentLine].Length)
_currentCol = lines [_currentLine].Length;
else
_currentCol = value;
+ requestedColumn = CurrentTabulatedColumn;
+ //requestedColumn = _currentCol;
+
PositionChanged.Raise (this, null);
}
}
_currentLine = 0;
else
_currentLine = value;
-
- if (_currentCol > lines [_currentLine].Length)
+// if (_currentCol < 0)
+// requestedColumn = tabu _currentCol;
+ int tabulatedRequestedCol = ConverteTabulatedPosOfCurLine(requestedColumn);
+ if (requestedColumn > lines [_currentLine].PrintableLength)
_currentCol = lines [_currentLine].Length;
+ else
+ //_currentCol = requestedColumn;
+ _currentCol = tabulatedRequestedCol;
//Debug.WriteLine ("buff cur line: " + _currentLine);
PositionChanged.Raise (this, null);
}
using System;
using System.Text;
using System.Collections.Generic;
+using System.Linq;
namespace Crow.Coding
{
return string.IsNullOrEmpty (Content) ? 0 : Content.Length;
}
}
+ public int FirstNonBlankTokIndex {
+ get { return Tokens == null ? -1 : Tokens.FindIndex (tk=>tk.Type != BufferParser.TokenType.WhiteSpace); }
+ }
public void SetLineInError (ParserException ex) {
Tokens = null;
formatting.Add ((int)BufferParser.TokenType.BlockComment, new TextFormatting (Color.Gray, Color.Transparent, false, true));
formatting.Add ((int)BufferParser.TokenType.LineComment, new TextFormatting (Color.Gray, Color.Transparent, false, true));
- formatting.Add ((int)BufferParser.TokenType.Affectation, new TextFormatting (Color.Black, Color.Transparent));
+ formatting.Add ((int)BufferParser.TokenType.OperatorOrPunctuation, new TextFormatting (Color.Black, Color.Transparent));
formatting.Add ((int)BufferParser.TokenType.Keyword, new TextFormatting (Color.DarkCyan, Color.Transparent));
parsing.Add (".crow", "Crow.Coding.XMLParser");
NotifyValueChanged ("VisibleLines", visibleLines);
updateMaxScrollY ();
updatePrintedLines ();
+ RegisterForGraphicUpdate ();
// System.Diagnostics.Debug.WriteLine ("update visible lines: " + visibleLines);
// System.Diagnostics.Debug.WriteLine ("update MaxScrollY: " + MaxScrollY);
}
i++;
}
}
- RegisterForGraphicUpdate ();
}
void toogleFolding (int line) {
if (parser == null || !foldingEnabled)
buffer.longestLineIdx++;
if (parser == null)
continue;
- parser.tryParseBufferLine (e.LineStart + i);
+ parser.TryParseBufferLine (e.LineStart + i);
}
measureLeftMargin ();
void Buffer_FoldingEvent (object sender, CodeBufferEventArgs e)
{
updatePrintedLines ();
+ updateOnScreenCurLineFromBuffCurLine ();
updateMaxScrollY ();
RegisterForGraphicUpdate ();
}
void loadSource () {
try {
- buffer.Load (projFile.Source);
+
+ if (parser == null)
+ buffer.Load (projFile.Source);
+ else//parser may have special linebrk rules
+ buffer.Load (projFile.Source, parser.LineBrkRegex);
+
} catch (Exception ex) {
Debug.WriteLine (ex.ToString ());
}
return;
base.ScrollY = value;
updatePrintedLines ();
+ updateOnScreenCurLineFromBuffCurLine ();
+ RegisterForGraphicUpdate ();
}
}
if (buffer.SelectionInProgress){
selStartCol = getTabulatedColumn (buffer.SelectionStart);
selEndCol = getTabulatedColumn (buffer.SelectionEnd);
- }else if (HasFocus){
+ }else if (HasFocus && printedCurrentLine >= 0){
gr.LineWidth = 1.0;
double cursorX = cb.X + (getTabulatedColumn(buffer.CurrentPosition) - ScrollX) * fe.MaxXAdvance + leftMargin;
gr.MoveTo (0.5 + cursorX, cb.Y + (printedCurrentLine) * fe.Height);
#region Mouse handling
- void updateCurrentPos(){
+ void updateCurrentPosFromMouseLocalPos(){
PrintedCurrentLine = (int)Math.Max (0, Math.Floor (mouseLocalPos.Y / fe.Height));
int curVisualCol = ScrollX + (int)Math.Round ((mouseLocalPos.X - leftMargin) / fe.MaxXAdvance);
return;
//mouse is down
- updateCurrentPos();
+ updateCurrentPosFromMouseLocalPos();
buffer.SetSelEndPos ();
}
public override void onMouseDown (object sender, MouseButtonEventArgs e)
return;
}
- updateCurrentPos ();
+ updateCurrentPosFromMouseLocalPos ();
buffer.SetSelStartPos ();
}
public override void onMouseUp (object sender, MouseButtonEventArgs e)
case ',':
if (curState != States.init || curState != States.classNames )
throw new ParserException (currentLine, currentColumn, "Unexpected char ','");
- readAndResetCurrentTok (TokenType.UnaryOp, true);
+ readAndResetCurrentTok (TokenType.OperatorOrPunctuation, true);
curState = States.classNames;
break;
case '{':
case '=':
if (curState == States.classNames)
throw new ParserException (currentLine, currentColumn, "Unexpected char '='");
- readAndResetCurrentTok (TokenType.Affectation, true);
+ setPreviousTokOfTypeTo (TokenType.Type, TokenType.Identifier);
+ readAndResetCurrentTok (TokenType.OperatorOrPunctuation, true);
curState = States.value;
break;
case '"':
while (nextCharIsValidCharName)
readToCurrTok ();
}
- saveAndResetCurrentTok (TokenType.Identifier);
+ saveAndResetCurrentTok (TokenType.Type);
break;
}
}
public override void SyntaxAnalysis ()
{
RootNode = new Node () { Name = "RootNode", Type="Root" };
+
+ Node currentNode = RootNode;
+
+ for (int i = 0; i < buffer.LineCount; i++) {
+ CodeLine cl = buffer[i];
+ if (cl.Tokens == null)
+ continue;
+ cl.SyntacticNode = null;
+
+ int tokPtr = 0;
+ while (tokPtr < cl.Tokens.Count) {
+ switch (cl.Tokens [tokPtr].Type) {
+ case TokenType.OpenBlock:
+ Node newElt = new Node () { Name = cl.Tokens [tokPtr].Content, StartLine = cl };
+ currentNode.AddChild (newElt);
+ currentNode = newElt;
+ if (cl.SyntacticNode == null)
+ cl.SyntacticNode = newElt;
+ break;
+ case TokenType.CloseBlock:
+ currentNode.EndLine = cl;
+ currentNode = currentNode.Parent;
+ break;
+ }
+ tokPtr++;
+ }
+ }
}
}
}
ElementName = BufferParser.TokenType.Type,
AttributeName = BufferParser.TokenType.Identifier,
ElementClosing = BufferParser.TokenType.StatementEnding,
- Affectation = BufferParser.TokenType.Affectation,
+ Affectation = BufferParser.TokenType.OperatorOrPunctuation,
AttributeValueOpening = BufferParser.TokenType.StringLitteralOpening,
AttributeValueClosing = BufferParser.TokenType.StringLitteralClosing,
AttributeValue = BufferParser.TokenType.StringLitteral,
--- /dev/null
+<?xml version="1.0"?>
+<HorizontalStack Style="MemberViewHStack" ContextCommands="{Commands}">
+ <Label Style="MemberViewLabel" Text="{Name}" Foreground = "{LabForeground}"/>
+ <ComboBox Margin="0" Height="Stretched" Width="50%" Data="{Choices}"
+ SelectedItem="{²Value}">
+ <Template>
+ <Popper Name="popper" PopDirection="Bottom">
+ <Template>
+ <CheckBox Caption="{./Caption}" IsChecked="{²./IsPopped}" Foreground="{./Foreground}" Background="{./Background}">
+ <Template>
+ <Border CornerRadius="0" Foreground="LightGray" Background="White">
+ <HorizontalStack Margin="0" Spacing="1">
+ <Label Width="Stretched" MinimumSize="80,10" Margin="1" Foreground = "{LabForeground}" Background="White"
+ Text="{../../../../../SelectedItem}"/>
+ <Button Width="12" Height="12" Focusable="false"
+ Template="#Crow.Templates.ArrowBut.template">
+ <Image Margin="1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
+ </Button>
+ </HorizontalStack>
+ </Border>
+ </Template>
+ </CheckBox>
+ </Template>
+ <Border Background="White" BorderWidth="1" Margin="1" Foreground="Black"
+ MinimumSize="{../../MinimumPopupSize}" Fit="true">
+ <Scroller Name="scroller1" Margin="2" VerticalScrolling="true"
+ MaximumSize="0,200"
+ HorizontalAlignment="Left"
+ ValueChanged="../../../_scroller_ValueChanged">
+ <VerticalStack LayoutChanged="../../../../_list_LayoutChanged"
+ MouseClick="../../../onMouseClick" Focusable="True"
+ Height="Fit" Name="ItemsContainer" Margin="0"
+ HorizontalAlignment="Left"
+ VerticalAlignment="Top"/>
+ </Scroller>
+ </Border>
+ </Popper>
+ </Template>
+ <ItemTemplate>
+ <Container Fit="true" Margin="0" Focusable="true"
+ HorizontalAlignment="Left"
+ MouseEnter="{Background=SteelBlue}"
+ MouseLeave="{Background=Transparent}">
+ <Label Text="{}" Foreground="Black"/>
+ </Container>
+ </ItemTemplate>
+ </ComboBox>
+</HorizontalStack>
--- /dev/null
+<?xml version="1.0"?>
+<HorizontalStack Style="MemberViewHStack" ContextCommands="{Commands}">
+ <Label Style="MemberViewLabel" Text="{Name}" Foreground = "{LabForeground}"/>
+ <Popper Height="Stretched" Caption="{Value}">
+ <Template>
+ <CheckBox Caption="{./Caption}" IsChecked="{²./IsPopped}">
+ <Template>
+ <HorizontalStack Margin="1" Height="Stretched" Spacing="3" Background="White">
+ <Border Foreground="{LabForeground}" Width="18" Height="12" CornerRadius="3"
+ Background="{Value}">
+ </Border>
+ <Label Width="Stretched" Text="{./Caption}" Foreground="{LabForeground}"/>
+ </HorizontalStack>
+ </Template>
+ </CheckBox>
+ </Template>
+ <ColorPicker SelectedColor="{²Value}" Background="Onyx" Margin="5" Fit="True" />
+ </Popper>
+</HorizontalStack>
\ No newline at end of file
<CheckBox Background="White" Foreground = "{LabForeground}" Height="Stretched" Caption="" IsChecked="{²Value}"/>
</HorizontalStack>
</ItemTemplate>
-<ItemTemplate DataType="System.Enum">
- <HorizontalStack Style="MemberViewHStack" ContextCommands="{Commands}">
- <Label Style="MemberViewLabel" Text="{Name}" Foreground = "{LabForeground}"/>
- <ComboBox Margin="0" Height="Stretched" Width="50%" Data="{Choices}"
- SelectedItem="{²Value}">
- <Template>
- <Popper Name="popper" PopDirection="Bottom">
- <Template>
- <CheckBox Caption="{./Caption}" IsChecked="{²./IsPopped}" Foreground="{./Foreground}" Background="{./Background}">
- <Template>
- <Border CornerRadius="0" Foreground="LightGray" Background="White">
- <HorizontalStack Margin="0" Spacing="1">
- <Label Width="Stretched" MinimumSize="80,10" Margin="1" Foreground = "{LabForeground}" Background="White"
- Text="{../../../../../SelectedItem}"/>
- <Button Width="12" Height="12" Focusable="false"
- Template="#Crow.Templates.ArrowBut.template">
- <Image Margin="1" Path="#Crow.Images.Icons.updown.svg" SvgSub="down"/>
- </Button>
- </HorizontalStack>
- </Border>
- </Template>
- </CheckBox>
- </Template>
- <Border Background="White" BorderWidth="1" Margin="1" Foreground="Black"
- MinimumSize="{../../MinimumPopupSize}" Fit="true">
- <Scroller Name="scroller1" Margin="2" VerticalScrolling="true"
- MaximumSize="0,200"
- HorizontalAlignment="Left"
- ValueChanged="../../../_scroller_ValueChanged">
- <VerticalStack LayoutChanged="../../../../_list_LayoutChanged"
- MouseClick="../../../onMouseClick" Focusable="True"
- Height="Fit" Name="ItemsContainer" Margin="0"
- HorizontalAlignment="Left"
- VerticalAlignment="Top"/>
- </Scroller>
- </Border>
- </Popper>
- </Template>
- <ItemTemplate>
- <Container Fit="true" Margin="0" Focusable="true"
- HorizontalAlignment="Left"
- MouseEnter="{Background=SteelBlue}"
- MouseLeave="{Background=Transparent}">
- <Label Text="{}" Foreground="Black"/>
- </Container>
- </ItemTemplate>
- </ComboBox>
- </HorizontalStack>
-</ItemTemplate>
-<ItemTemplate DataType="Crow.Fill">
- <HorizontalStack Style="MemberViewHStack" ContextCommands="{Commands}">
- <Label Style="MemberViewLabel" Text="{Name}" Foreground = "{LabForeground}"/>
- <Popper Height="Stretched" Caption="{Value}">
- <Template>
- <CheckBox Caption="{./Caption}" IsChecked="{²./IsPopped}">
- <Template>
- <HorizontalStack Margin="1" Height="Stretched" Spacing="3" Background="White">
- <Border Foreground="{LabForeground}" Width="18" Height="12" CornerRadius="3"
- Background="{Value}">
- </Border>
- <Label Width="Stretched" Text="{./Caption}" Foreground="{LabForeground}"/>
- </HorizontalStack>
- </Template>
- </CheckBox>
- </Template>
- <ColorPicker SelectedColor="{²Value}" Background="Onyx" Margin="5" Fit="True" />
- </Popper>
- </HorizontalStack>
-</ItemTemplate>
\ No newline at end of file
+<ItemTemplate Path="#Crow.Coding.ui.ItemTemplates.Enum.template" DataType="System.Enum" />
+<ItemTemplate Path="#Crow.Coding.ui.ItemTemplates.Enum.template" DataType="Style" />
+<ItemTemplate Path="#Crow.Coding.ui.ItemTemplates.Fill.template" DataType="Crow.Fill"/>
+
\ No newline at end of file
AllowDrag = "true";
}
MessageBox {
- Background = "0.3,0.3,0.3,0.3";
+ Background = "0.1,0.1,0.2,0.7";
Width = "Fit";
Caption="MessageBox";
Font = "serif, 12";
<GraphicObject Width="5" Height="5"/>
</HorizontalStack>
</Border>
- <HorizontalStack Margin="5">
+ <HorizontalStack Margin="5" >
<Image Name="Image" Width="50" Height="30" Path="{./MsgIcon}" />
- <Label Margin="5" Font="{./Font}" Width="Fit" Text="{./Message}"
- TextAlignment="Left"
+ <Label Margin="5" Font="{./Font}" Width="Fit" Text="{./Message}"
+ TextAlignment="Center"
Multiline="true" />
</HorizontalStack>
- <HorizontalStack Margin="1" Spacing="0" Width="Fit" Height="Fit" HorizontalAlignment="Right">
+ <HorizontalStack Margin="4" Spacing="0" Width="Fit" Height="Fit" HorizontalAlignment="Right">
<Button Width="Fit" Caption="{./OkMessage}" MouseClick="./onOkButtonClick" />
- <Button Width="Fit" Caption="{./CancelMessage}" MouseClick="./onCancelButtonClick" />
+ <Button Width="Fit" Visible="{./NoButIsVisible}"
+ Caption="{./NoMessage}" MouseClick="./onNoButtonClick" />
+ <Button Width="Fit" Visible="{./CancelButIsVisible}"
+ Caption="{./CancelMessage}" MouseClick="./onCancelButtonClick" />
</HorizontalStack>
</VerticalStack>
</Border>
FpsLabel {
- Width = 50%;
- Font = droid, 10;
- Margin = 0;
- TextAlignment = Center;
- Background = Onyx;
+ Width = "50%";
+ Font = "droid, 10";
+ Margin = "0";
+ TextAlignment = "Center";
+ Background = "Onyx";
}
FpsDisp {
- Font = droid bold, 10;
- Width = 50%;
- Margin = 0;
- TextAlignment = Center;
- Background = Teal;
+ Font = "droid bold, 10";
+ Width = "50%";
+ Margin = "0";
+ TextAlignment = "Center";
+ Background = "Teal";
}
CheckBox2 {
- Template= #Tests.Interfaces.CheckBox2.imlt;
- Background = Onyx;
- Checked={Background=Mantis;Font=droid bold, 10};
- Unchecked = {Background=Onyx;Font=droid,10};
+ Template= "#Tests.Interfaces.CheckBox2.imlt";
+ Background = "Onyx";
+ Checked="{Background=Mantis;Font=droid bold, 10}";
+ Unchecked = "{Background=Onyx;Font=droid,10}";
}
RadioButton2 {
- Template=#Tests.Interfaces.CheckBox2.imlt;
- Background = Onyx;
- Checked = {Background=Mantis;Font=droid bold, 10};
- Unchecked = {Background=Onyx;Font=droid,10};
+ Template="#Tests.Interfaces.CheckBox2.imlt";
+ Background = "Onyx";
+ Checked = "{Background=Mantis;Font=droid bold, 10}";
+ Unchecked = "{Background=Onyx;Font=droid,10}";
}
labPerf {
- Font = droid, 8;
- Width = 50%;
+ Font = "droid, 8";
+ Width = "50%";
}
labPerfVal{
- Font = droid, 8;
- Width = 50%;
+ Font = "droid, 8";
+ Width = "50%";
}
-MouseEnter = {Background = Gray;Foreground = White;}
-Fit = true;
-MouseLeave = {Background=Transparent;Foreground=Gray;}
-MouseDown = {Background=Red;Foreground=White;}
-MouseUp = {Background=Gray;Foreground=White;}
-Foreground=Gray;
-Margin=5;
-CornerRadius=5;
+MouseEnter = "{Background = Gray;Foreground = White;}";
+Fit = "true";
+MouseLeave = "{Background=Transparent;Foreground=Gray;}";
+MouseDown = "{Background=Red;Foreground=White;}";
+MouseUp = "{Background=Gray;Foreground=White;}";
+Foreground="Gray";
+Margin="5";
+CornerRadius="5";
-Height = Fit;
-Width = Stretched;
-MinimumSize=60;10;
-Margin=2;
-CornerRadius=0;
-TextAlignment=Left;
-Foreground=Gray;
-MouseEnter = {Background=SeaGreen;Foreground=White;}
-MouseLeave = {Background=Transparent;Foreground=Gray;}
-MouseDown = {Background=White;Foreground=DimGray;}
-MouseUp = {Background=SeaGreen;Foreground=White;}
+Height = "Fit";
+Width = "Stretched";
+MinimumSize="60;10";
+Margin="2";
+CornerRadius="0";
+TextAlignment="Left";
+Foreground="Gray";
+MouseEnter = "{Background=SeaGreen;Foreground=White;}";
+MouseLeave = "{Background=Transparent;Foreground=Gray;}";
+MouseDown = "{Background=White;Foreground=DimGray;}";
+MouseUp = "{Background=SeaGreen;Foreground=White;}";
public virtual void OnTextChanged(Object sender, TextChangeEventArgs e)
{
+ textMeasureIsUpToDate = false;
NotifyValueChanged ("Text", Text);
TextChanged.Raise (this, e);
}
CurrentColumn = 0;
OnTextChanged (this, new TextChangeEventArgs (Text));
}
+ bool textMeasureIsUpToDate = false;
+ Size cachedTextSize = default(Size);
#region GraphicObject overrides
protected override int measureRawSize(LayoutingType lt)
- {
+ {
if (lines == null)
lines = getLines;
-
- using (ImageSurface img = new ImageSurface (Format.Argb32, 10, 10)) {
- using (Context gr = new Context (img)) {
- //Cairo.FontFace cf = gr.GetContextFontFace ();
-
- gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);
- gr.SetFontSize (Font.Size);
-
-
- fe = gr.FontExtents;
- te = new TextExtents();
-
- if (lt == LayoutingType.Height){
- int lc = lines.Count;
- //ensure minimal height = text line height
- if (lc == 0)
- lc = 1;
-
- return (int)Math.Ceiling(fe.Height * lc) + Margin * 2;
+ if (!textMeasureIsUpToDate) {
+ using (ImageSurface img = new ImageSurface (Format.Argb32, 10, 10)) {
+ using (Context gr = new Context (img)) {
+ //Cairo.FontFace cf = gr.GetContextFontFace ();
+
+ gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);
+ gr.SetFontSize (Font.Size);
+ gr.FontOptions = Interface.FontRenderingOptions;
+ gr.Antialias = Interface.Antialias;
+
+ fe = gr.FontExtents;
+ te = new TextExtents ();
+
+ cachedTextSize.Height = (int)Math.Ceiling ((fe.Ascent+fe.Descent) * Math.Max (1, lines.Count)) + Margin * 2;
+
+ try {
+ foreach (string s in lines) {
+ string l = s.Replace ("\t", new String (' ', Interface.TabSize));
+
+ TextExtents tmp = gr.TextExtents (l);
+
+ if (tmp.XAdvance > te.XAdvance)
+ te = tmp;
+ }
+ cachedTextSize.Width = (int)Math.Ceiling (te.XAdvance) + Margin * 2;
+ textMeasureIsUpToDate = true;
+ } catch {
+ return -1;
+ }
}
- try {
- foreach (string s in lines) {
- string l = s.Replace("\t", new String (' ', Interface.TabSize));
-
- TextExtents tmp = gr.TextExtents (l);
-
- if (tmp.XAdvance > te.XAdvance)
- te = tmp;
- }
- } catch (Exception ex) {
- return -1;
- }
- return (int)Math.Ceiling (te.XAdvance) + Margin * 2;
}
+
}
- }
+ return lt == LayoutingType.Height ? cachedTextSize.Height : cachedTextSize.Width;
+ }
protected override void onDraw (Context gr)
{
base.onDraw (gr);
break;
case Alignment.Center://ok
rText.X = cb.X + cb.Width / 2 - rText.Width / 2;
- rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;
+ //rText.Y = cb.Y + cb.Height / 2 - rText.Height / 2;
+ rText.Y = cb.Y + (int)Math.Floor((double)cb.Height / 2.0 - (double)rText.Height / 2.0);
break;
}
- gr.FontMatrix = new Matrix(widthRatio * (float)Font.Size, 0, 0, heightRatio * (float)Font.Size, 0, 0);
+ //gr.FontMatrix = new Matrix(widthRatio * (float)Font.Size, 0, 0, heightRatio * (float)Font.Size, 0, 0);
fe = gr.FontExtents;
#region draw text cursor
Foreground.SetAsSource (gr);
gr.LineWidth = 1.0;
- gr.MoveTo (0.5 + textCursorPos + rText.X, rText.Y + CurrentLine * fe.Height);
- gr.LineTo (0.5 + textCursorPos + rText.X, rText.Y + (CurrentLine + 1) * fe.Height);
+ gr.MoveTo (0.5 + textCursorPos + rText.X, rText.Y + CurrentLine * (fe.Ascent+fe.Descent));
+ gr.LineTo (0.5 + textCursorPos + rText.X, rText.Y + (CurrentLine + 1) * (fe.Ascent+fe.Descent));
gr.Stroke();
}
#endregion
// new SolidColor(Color.DarkGreen).SetAsSource(gr);
// Rectangle R = new Rectangle (
// rText.X + (int)SelEndCursorPos - 3,
-// rText.Y + (int)(SelRelease.Y * fe.Height),
+// rText.Y + (int)(SelRelease.Y * (fe.Ascent+fe.Descent)),
// 6,
-// (int)fe.Height);
+// (int)(fe.Ascent+fe.Descent));
// gr.Rectangle (R);
// gr.Fill ();
// }
// new SolidColor(Color.DarkRed).SetAsSource(gr);
// Rectangle R = new Rectangle (
// rText.X + (int)SelStartCursorPos - 3,
-// rText.Y + (int)(SelBegin.Y * fe.Height),
+// rText.Y + (int)(SelBegin.Y * (fe.Ascent+fe.Descent)),
// 6,
-// (int)fe.Height);
+// (int)(fe.Ascent+fe.Descent));
// gr.Rectangle (R);
// gr.Fill ();
// }
int lineLength = (int)gr.TextExtents (l).XAdvance;
Rectangle lineRect = new Rectangle (
rText.X,
- rText.Y + (int)Math.Ceiling(i * fe.Height),
+ rText.Y + (int)Math.Floor((double)i * (fe.Ascent+fe.Descent)),
lineLength,
- (int)Math.Ceiling(fe.Height));
+ (int)Math.Ceiling((fe.Ascent+fe.Descent)));
// if (TextAlignment == Alignment.Center ||
// TextAlignment == Alignment.Top ||
continue;
Foreground.SetAsSource (gr);
- gr.MoveTo (lineRect.X, rText.Y + fe.Ascent + fe.Height * i);
+ gr.MoveTo (lineRect.X,(double)rText.Y + fe.Ascent + (fe.Ascent+fe.Descent) * i) ;
gr.ShowText (l);
gr.Fill ();
gr.Save ();
gr.Clip ();
gr.SetSourceColor (SelectionForeground);
- gr.MoveTo (lineRect.X, rText.Y + fe.Ascent + fe.Height * i);
+ gr.MoveTo (lineRect.X, (double)rText.Y + fe.Ascent + (fe.Ascent+fe.Descent) * i);
gr.ShowText (l);
gr.Fill ();
gr.Restore ();
double cPos = 0f;
- CurrentLine = (int)(mouseLocalPos.Y / fe.Height);
+ CurrentLine = (int)(mouseLocalPos.Y / (fe.Ascent+fe.Descent));
//fix cu
if (CurrentLine >= lines.Count)
#endregion
public enum Type {
+ None,
Information,
- YesNo,
Alert,
- Error
+ Error,
+ YesNo,
+ YesNoCancel,
+
}
protected override void loadTemplate (GraphicObject template)
base.loadTemplate (template);
NotifyValueChanged ("MsgIcon", "#Crow.Images.Icons.Informations.svg");
}
- string message, okMessage, cancelMessage;
- Type msgType = Type.Information;
+ string message, okMessage, cancelMessage, noMessage;
+ Type msgType = Type.None;
- public event EventHandler Ok;
+ public event EventHandler Yes;
+ public event EventHandler No;
public event EventHandler Cancel;
- [XmlAttributeAttribute][DefaultValue("Informations")]
+ [DefaultValue("Informations")]
public virtual string Message
{
get { return message; }
NotifyValueChanged ("Message", message);
}
}
- [XmlAttributeAttribute][DefaultValue("Ok")]
+ [DefaultValue("Ok")]
public virtual string OkMessage
{
get { return okMessage; }
NotifyValueChanged ("OkMessage", okMessage);
}
}
- [XmlAttributeAttribute][DefaultValue("Cancel")]
+ [DefaultValue("Cancel")]
public virtual string CancelMessage
{
get { return cancelMessage; }
NotifyValueChanged ("CancelMessage", cancelMessage);
}
}
- [XmlAttributeAttribute][DefaultValue("Information")]
+ [DefaultValue("No")]
+ public virtual string NoMessage
+ {
+ get { return cancelMessage; }
+ set {
+ if (cancelMessage == value)
+ return;
+ cancelMessage = value;
+ NotifyValueChanged ("NoMessage", cancelMessage);
+ }
+ }
+ [DefaultValue("Information")]
public virtual Type MsgType
{
get { return msgType; }
NotifyValueChanged ("MsgType", msgType);
switch (msgType) {
case Type.Information:
- NotifyValueChanged ("MsgIcon", "#Crow.Images.Icons.Informations.svg");
+ MsgIcon = "#Crow.Images.Icons.Informations.svg";
Caption = "Informations";
OkMessage = "Ok";
- CancelMessage = "Cancel";
+ NotifyValueChanged ("CancelButIsVisible", false);
+ NotifyValueChanged ("NoButIsVisible", false);
break;
case Type.YesNo:
- NotifyValueChanged ("MsgIcon", "#Crow.Icons.question.svg");
+ case Type.YesNoCancel:
+ MsgIcon = "#Crow.Icons.question.svg";
Caption = "Choice";
OkMessage = "Yes";
- CancelMessage = "No";
+ NoMessage = "No";
+ NotifyValueChanged ("CancelButIsVisible", msgType == Type.YesNoCancel);
+ NotifyValueChanged ("NoButIsVisible", true);
break;
case Type.Alert:
- NotifyValueChanged ("MsgIcon", "#Crow.Images.Icons.IconAlerte.svg");
+ MsgIcon = "#Crow.Images.Icons.IconAlerte.svg";
Caption = "Alert";
OkMessage = "Ok";
CancelMessage = "Cancel";
+ NotifyValueChanged ("CancelButIsVisible", true);
+ NotifyValueChanged ("NoButIsVisible", false);
break;
case Type.Error:
- NotifyValueChanged ("MsgIcon", "#Crow.Images.Icons.exit.svg");
+ MsgIcon = "#Crow.Images.Icons.exit.svg";
Caption = "Error";
OkMessage = "Ok";
+ NotifyValueChanged ("CancelButIsVisible", false);
+ NotifyValueChanged ("NoButIsVisible", false);
break;
}
}
}
+
+ string msgIcon = null;
+ public string MsgIcon {
+ get { return msgIcon; }
+ set {
+ if (value == MsgIcon)
+ return;
+ msgIcon = value;
+ NotifyValueChanged ("MsgIcon", MsgIcon);
+ }
+ }
void onOkButtonClick (object sender, EventArgs e)
{
- Ok.Raise (this, null);
+ Yes.Raise (this, null);
+ close ();
+ }
+ void onNoButtonClick (object sender, EventArgs e)
+ {
+ No.Raise (this, null);
close ();
}
void onCancelButtonClick (object sender, EventArgs e)
return mb;
}
}
+ public static MessageBox ShowModal (Interface iface, Type msgBoxType, string message){
+ lock (iface.UpdateMutex) {
+ MessageBox mb = new MessageBox (iface) {
+ Modal = true,
+ MsgType = msgBoxType,
+ Message = message
+ };
+
+ iface.AddWidget (mb);
+ return mb;
+ }
+ }
}
}
}
string _icon;
- bool _resizable;
- bool _movable;
+ bool resizable;
+ bool movable;
+ bool modal;
protected bool hoverBorder = false;
bool alwaysOnTop = false;
Fill titleBarBackground = Color.UnitedNationsBlue;
[XmlAttributeAttribute][DefaultValue(true)]
public bool Resizable {
get {
- return _resizable;
+ return resizable;
}
set {
- if (_resizable == value)
+ if (resizable == value)
return;
- _resizable = value;
- NotifyValueChanged ("Resizable", _resizable);
+ resizable = value;
+ NotifyValueChanged ("Resizable", resizable);
}
}
[XmlAttributeAttribute][DefaultValue(true)]
public bool Movable {
get {
- return _movable;
+ return movable;
}
set {
- if (_movable == value)
+ if (movable == value)
return;
- _movable = value;
- NotifyValueChanged ("Movable", _movable);
+ movable = value;
+ NotifyValueChanged ("Movable", movable);
+ }
+ }
+ [XmlAttributeAttribute][DefaultValue(false)]
+ public bool Modal {
+ get {
+ return modal;
+ }
+ set {
+ if (modal == value)
+ return;
+ modal = value;
+ NotifyValueChanged ("Modal", modal);
}
}
[XmlAttributeAttribute][DefaultValue(false)]
[XmlAttributeAttribute][DefaultValue(false)]
public bool AlwaysOnTop {
get {
- return alwaysOnTop;
+ return modal ? true : alwaysOnTop;
}
set {
if (alwaysOnTop == value)
return;
+
alwaysOnTop = value;
- if (alwaysOnTop && Parent != null)
+ if (AlwaysOnTop && Parent != null)
IFace.PutOnTop (this);
- NotifyValueChanged ("AlwaysOnTop", alwaysOnTop);
+ NotifyValueChanged ("AlwaysOnTop", AlwaysOnTop);
}
}
// [XmlAttributeAttribute()][DefaultValue(WindowState.Normal)]
return;
}
- if (this.HasFocus && _movable) {
+ if (this.HasFocus && movable) {
if (e.Mouse.IsButtonDown (MouseButton.Left)) {
MoveAndResize (e.XDelta, e.YDelta, currentDirection);
return;
{
base.onMouseDown (sender, e);
}
+ public override bool MouseIsIn (Point m)
+ {
+ return modal ? true : base.MouseIsIn (m);
+ }
#endregion
protected void onMaximized (object sender, EventArgs e){