Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement (compatibility with Msft CLI/C++) + Code Cleansing and Refactoring #338

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

nfasvp
Copy link

@nfasvp nfasvp commented Feb 20, 2022

  • Code Cleansing & Refactoring:

    • moved all p/invoke declarations to a new static class "NativeWin" (NativeWin.cs)

      • there was a significant number of duplicated declarations on several controls
      • affected files:
        • NativeTextRenderer.cs
        • MouseWheelRedirector.cs
        • MaterialDialog.cs
        • MaterialForm.cs
        • MaterialMultiLineTextBox.cs
        • MaterialMultiLineTextBox2.cs
        • MaterialScrollBar.cs
        • MaterialSnackBar.cs
        • MaterialTextBox.cs
        • MaterialSkinManager.cs
    • moved several const declarations related to native Window Message IDs to new static class "NativeWin"

      • affected files:
        • MouseWheelRedirector.cs
    • moved all possible category's labels to a new static class "CategoryLabels" (Globals.cs) and replaced the Category Labels by the corresponding const string

      • affected files:
        • MaterialButton.cs
        • MaterialCheckBox.cs
        • MaterialComboBox.cs
        • MaterialDrawer.cs
        • MaterialExpansionPanel.cs
        • MaterialFloatingActionButton.cs
        • MaterialForm.cs
        • MaterialLabel.cs
        • MaterialListBox.cs
        • MaterialListView.cs
        • MaterialMaskedTextBox.cs
        • MaterialMultiLineTextBox.cs
        • MaterialMultiLineTextBox2.cs
        • MaterialRadioButton.cs
        • MaterialScrollBar.cs
        • MaterialSlider.cs
        • MaterialSnackBar.cs
        • MaterialSwitch.cs
        • MaterialTabSelector.cs
        • MaterialTextBox.cs
        • MaterialTextBox2.cs
    • moved several const declarations and enum declarations that were shared among files to a new file Globals.cs

      • MaterialDrawer.cs
  • Enhancement - compatibility with Msft CLI/C++:

    • enum value MouseState.OUT (IMaterialControl.cs) renamed to MouseState.OUT_
      • "OUT" keyword is a reserved word on CLI/C++.

Nuno Pereira and others added 4 commits February 20, 2022 11:36
-------------------------
  - Code Cleansing:
    - moved all p/invoke declarations to a new static class "NativeWin" (NativeWin.cs)
      - there were a significant number of duplicated declarations on several controls
      - affected files:
        - NativeTextRenderer.cs
        - MouseWheelRedirector.cs
        - MaterialDialog.cs
        - MaterialForm.cs
        - MaterialMultiLineTextBox.cs
        - MaterialMultiLineTextBox2.cs
        - MaterialScrollBar.cs
        - MaterialSnackBar.cs
        - MaterialTextBox.cs
        - MaterialSkinManager.cs

    - moved several const declarations related to native Window Message IDs to new static class "NativeWin"
      - affected files:
        - MouseWheelRedirector.cs

    - moved all possible category's labels to a new static class "CategoryLabels" (Globals.cs) and replaced the Category Labels by the corresponding const string
      - affected files:
        - MaterialButton.cs
        - MaterialCheckBox.cs
        - MaterialComboBox.cs
        - MaterialDrawer.cs
        - MaterialExpansionPanel.cs
        - MaterialFloatingActionButton.cs
        - MaterialForm.cs
        - MaterialLabel.cs
        - MaterialListBox.cs
        - MaterialListView.cs
        - MaterialMaskedTextBox.cs
        - MaterialMultiLineTextBox.cs
        - MaterialMultiLineTextBox2.cs
        - MaterialRadioButton.cs
        - MaterialScrollBar.cs
        - MaterialSlider.cs
        - MaterialSnackBar.cs
        - MaterialSwitch.cs
        - MaterialTabSelector.cs
        - MaterialTextBox.cs
        - MaterialTextBox2.cs

    - moved several const declarations and enum declarations that were shared among files to a new file Globals.cs
        - MaterialDrawer.cs

  - Enhancement - compatibility with Msft CLI/C++:
    - enum value MouseState.OUT (IMaterialControl.cs) renamed to MouseState.OUT_
      - "OUT" keyword is a reserved word on CLI/C++.
-------------------------
  - Enhancements:
    - Added support for "UserControl" Containers
      - Previous versions only supported placing controls like MaterialDialog if the Parent Container was of a type that inherits from Winform (Form class), like MaterialForm or plain Winform. Adding MaterialDialog control to a custom UserControl would generate a runtime exception because MaterialDialog._formOverlay was expecting an "Onwer" of type "Form" which is not the case when using parent containers like UserControls.
      - Changed class "MaterialDialog" to expect a Parent-container of type "ContainerControl", Form and UserControl classes inherit from ContainControl class.
      - Affected files:
        - MaterialDialog.cs
        - MaterialSkinManager.cs

    - Improved design-mode experience of MaterialDrawer when combined with MaterialTabControl object. Now, during design-time, it's possible to view the drawer and the design impact on it when drawer's and tabcontrol's properties are changed by the user.

    - Improved performance of MaterialDrawer during initialization
      - Reduced the number of "Redraws" (Pain events) while the MaterialDrawer control is being initialized by its container.
        - Previously, during MaterialDrawer's initialization, every property set done by the container that would impact drawer's UI would generate a redraw event (paint event).
        - Now, MaterialDrawer control checks if its container has finish the initialization and if not ignores the redraw. When container invokes control's "InitLayout" method, meaning "end of control's initialization phase, future propertities changes will invoke a redraw action.
Added support for "UserControl" Containers
-------------------------
  - Enhancements:
    - MaterialComboBox - better support for font customization (Item text and hint text)
      - user can change Item text font using properties pane, changes are rendered in design-mode as well as during runtime.
        - previously the item text font was hardcoded to "Subtitle1"
      - base property "Font" changed to "hidden". Avoids misleading the user since its value is not respected
      - new property "ItemMaterialFont" - user can choose from a list of "material fonts".
      - new property "ItemFont" - read-only property that shows in the "properties pane" the characteristics of the corresponding Font type defined by property "ItemMaterialFont", helping the user to understand the true meaning of the selected Material font
@orapps44
Copy link
Collaborator

Hi @nfasvp ,

Thank you for your work.

I'm not focused anymore on MaterialSkin project.
However considering your work on that PR, I will try to review it when I will have enough time. Please be patient.

@orapps44 orapps44 added this to the 2.3.2 milestone Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants