StackOverflowMATLABchat / mlapptools

MATLAB class containing methods for programmatic uifigure modification
http://undocumentedmatlab.com/blog/customizing-uifigures-part-2
MIT License
25 stars 11 forks source link

Adding support for `uidatepicker` #24

Open Dev-iL opened 6 years ago

Dev-iL commented 6 years ago

Summary

This is a type of element that was added in R2018b, having the following HTML structure:

<div id="undefined" data-type="matlab.ui.control.DatePicker" data-tag="e8b66256" class="vc-widget" style="left: 99px; bottom: 99px; width: 150px; height: 22px;">
  <div class="vc-datepicker" id="uniqName_29_0" widgetid="uniqName_29_0">
    <div class="mwWidget mwComboBox mwDatePicker dijitDownArrowButton mwEditableComboBox mwDefaultVisualFamily mwDisabledMixin mwEnabled mwEditableMixin mwDescriptionMixin mwSizeMixin" id="uniqName_54_0" widgetid="uniqName_54_0" aria-disabled="false" style="width: 150px; height: 22px;">
      <div class="mwComboBoxInnerContainer">
        <div class="mwTextFieldContainerNode" data-dojo-attach-point="textFieldContainerNode" style="width: calc(100% - 22px); background-color: rgb(255, 255, 255); box-shadow: rgba(255, 255, 255, 0.9) 0px 1px 0px 0px inset;">
          <div class="mwWidget mwTextField mwDefaultVisualFamily mwDescriptionMixin mwDisabledMixin mwEnabled mwHorizontalAlignmentMixin mwEditableMixin mwSizeMixin mwTextInputValueMixin mwHorizontalAlignmentRight" id="uniqName_65_0" widgetid="uniqName_65_0" data-tag="" aria-disabled="false" title="" style="width: 100%; height: 22px;">
            <input class="mwInputNode mwAlignmentNode" spellcheck="false" type="text" data-dojo-attach-point="inputNode,focusNode" tabindex="0" placeholder="mm/dd/yyyy" style="background-color: rgba(0, 0, 0, 0); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 12px; font-weight: normal; font-style: normal; color: rgb(0, 0, 0); font-variant: normal; font-stretch: normal; line-height: normal;">
            </div>
          </div>
          <div class="mwArrowContainerNode" data-dojo-attach-point="arrowNode">
            <div class="mwArrowNode">
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

For the above example, getWebElements currently returns id = uniqName_29_0, but this is not useful for styling. Instead (in addition?), uniqName_65_0 should be the returned handle.

Steps to Reproduce the Problem

hF = uifigure();
hDP = uidatepicker(hF);
mlapptools.setStyle(hDP, 'background', 'black')

Specifications

Additional Information