This patch provides for an implementation of the GUICheckButton control (type=checkbutton). This control had a partial implementation and was not exposed through the control factory. I have completed the implementation (based on some of my previous patches) and exposed it for use. This patch affects only GUICheckButton.cs and GUIControlFactory.cs (to expose the control for interpretation from the skin xml). Skin designers and plugin developers can make use of this new control.
This control offers a high degree of flexibility for both rendering and behavior. The "on click" logic for this button toggles the "selected" value for the control and then considers hyperlink and action.
Control attributes for this control are:
textureFocus - the button image when this control is in focus. Default is no texture.
textureNoFocus - the button image when this control is not in focus. Default is no texture.
font - the label font for the button. Default is no font.
label - the button label. Default is "".
textcolor - the label text color when the control is in focus. Default is 0xFFFFFFFF.
textcolorNoFocus - the label text color when the control is not in focus. Default is 0xFFFFFFFF.
disabledcolor - the label text color when the control is disabled. Default is 0xFF606060.
hyperlink - the window id of the window to go to when the button is clicked. Default is stay on same page.
action - the action id to perform when the button is clicked. Default is to perform no action.
script - the script to run when the button is clicked. Default is no script to run.
textXOff - the text X position offset from it's calculated position (see textalign and textvalign). Default is 0.
textYOff - the text Y position offset from it's calculated position (see textalign and textvalign). Default is 0.
application - the application to run when the button is clicked. Default is no application to run.
arguments - arguments to the "application" attributes.
textureCheckmarkNoFocus - the image to use to render the checkmark when the control is not in focus. Default is no image.
textureCheckmark - the image to use to render the checkmark when the control is in focus. Default is no image.
markWidth - The width of the checkmark. Default is to use the native width of the specified texture.
markHeight - The height of the checkmark. Default is to use the native height of the specified texture.
markXOff - the checkmark X position offset from it's calculated position (see markalign and markvalign). Default is 0.
markYOff - the checkmark Y position offset from it's calculated position (see markalign and markvalign). Default is 0.
markalign - the horizontal alignment of the checkmark; "left","right","center". Default is "left".
markvalign - the vertical alignment of the checkmark; "top","middle","bottom". Default is "top".
shadowAngle - the integral angle, in degrees, of the shadow text. Zero degrees is along the x-axis, increasing positive values from zero will rotate the shadow clockwise.
shadowDistance - the number of pixels the shadow is offset from the normal (foreground) text.
shadowColor - the color of the shadow. Default is 0xFFFFFFFF.
textalign - the horizontal alignment of the label; "left","right","center". Default is "left".
textvalign - the vertical alignment of the label; "top","middle","bottom". Default is "top".
The following border attributes apply to both textureFocus and textureNoFocus.
border - specifies a comma separated list of border edge thickness for each side of the border. The order of values is left, right, top, bottom. This field accepts either four integer values separated by commas or a single integer value which is then used for all four sides. Examples: "10" -or- "10,10,1,1"
position - specifies the position of the border relative to the image edges. Valid values are "outside", "inside", "center". The default value is "outside".
textureRepeat - specifies whether the texture used for the border should repeat or stretch inside each of the four rectangles that compose the overall border. The default value is "no".
textureRotate - specifies whether or not the texture used for the border should be rotated for each of the border rectangles. If the texture should rotate then the texture will be rotated 90 deg for the right border rectangle, 180 deg for the bottom, and 270 deg for the left. The default value is "no".
border, texture - specifies the tetxure filename for the border rectangles. A single file is used for all four of the border rectangles. Based on the value of textureRepeat, the entire texture extent is either stretched (scaled up/down) to fill the border rectangles or is scaled (up/down) to fit inside the border rectangle at its native aspect ratio and repeatedly drawn until the border rectangle is filled. The default value is "image_border.png". This texture file must exist in the skin media directory otherwise no border will be drawn. Example: <border texture="my_border.png">10</border>
border, colorKey - specfies the color key for the border texture. The default value is 0xFFFFFFFF. Example: <border colorKey="0x66FFFFFF">10</border>
Below is a complete example of usage along with a picture of the result. Notice the (unselected) circular checkmark at the right side of the control.
This control offers a high degree of flexibility for both rendering and behavior. The "on click" logic for this button toggles the "selected" value for the control and then considers hyperlink and action.
Control attributes for this control are:
textureFocus - the button image when this control is in focus. Default is no texture.
textureNoFocus - the button image when this control is not in focus. Default is no texture.
font - the label font for the button. Default is no font.
label - the button label. Default is "".
textcolor - the label text color when the control is in focus. Default is 0xFFFFFFFF.
textcolorNoFocus - the label text color when the control is not in focus. Default is 0xFFFFFFFF.
disabledcolor - the label text color when the control is disabled. Default is 0xFF606060.
hyperlink - the window id of the window to go to when the button is clicked. Default is stay on same page.
action - the action id to perform when the button is clicked. Default is to perform no action.
script - the script to run when the button is clicked. Default is no script to run.
textXOff - the text X position offset from it's calculated position (see textalign and textvalign). Default is 0.
textYOff - the text Y position offset from it's calculated position (see textalign and textvalign). Default is 0.
application - the application to run when the button is clicked. Default is no application to run.
arguments - arguments to the "application" attributes.
textureCheckmarkNoFocus - the image to use to render the checkmark when the control is not in focus. Default is no image.
textureCheckmark - the image to use to render the checkmark when the control is in focus. Default is no image.
markWidth - The width of the checkmark. Default is to use the native width of the specified texture.
markHeight - The height of the checkmark. Default is to use the native height of the specified texture.
markXOff - the checkmark X position offset from it's calculated position (see markalign and markvalign). Default is 0.
markYOff - the checkmark Y position offset from it's calculated position (see markalign and markvalign). Default is 0.
markalign - the horizontal alignment of the checkmark; "left","right","center". Default is "left".
markvalign - the vertical alignment of the checkmark; "top","middle","bottom". Default is "top".
shadowAngle - the integral angle, in degrees, of the shadow text. Zero degrees is along the x-axis, increasing positive values from zero will rotate the shadow clockwise.
shadowDistance - the number of pixels the shadow is offset from the normal (foreground) text.
shadowColor - the color of the shadow. Default is 0xFFFFFFFF.
textalign - the horizontal alignment of the label; "left","right","center". Default is "left".
textvalign - the vertical alignment of the label; "top","middle","bottom". Default is "top".
The following border attributes apply to both textureFocus and textureNoFocus.
border - specifies a comma separated list of border edge thickness for each side of the border. The order of values is left, right, top, bottom. This field accepts either four integer values separated by commas or a single integer value which is then used for all four sides. Examples: "10" -or- "10,10,1,1"
position - specifies the position of the border relative to the image edges. Valid values are "outside", "inside", "center". The default value is "outside".
textureRepeat - specifies whether the texture used for the border should repeat or stretch inside each of the four rectangles that compose the overall border. The default value is "no".
textureRotate - specifies whether or not the texture used for the border should be rotated for each of the border rectangles. If the texture should rotate then the texture will be rotated 90 deg for the right border rectangle, 180 deg for the bottom, and 270 deg for the left. The default value is "no".
border, texture - specifies the tetxure filename for the border rectangles. A single file is used for all four of the border rectangles. Based on the value of textureRepeat, the entire texture extent is either stretched (scaled up/down) to fill the border rectangles or is scaled (up/down) to fit inside the border rectangle at its native aspect ratio and repeatedly drawn until the border rectangle is filled. The default value is "image_border.png". This texture file must exist in the skin media directory otherwise no border will be drawn. Example: <border texture="my_border.png">10</border>
border, colorKey - specfies the color key for the border texture. The default value is 0xFFFFFFFF. Example: <border colorKey="0x66FFFFFF">10</border>
Below is a complete example of usage along with a picture of the result. Notice the (unselected) circular checkmark at the right side of the control.
Code:
<control>
<description>auto delete recordings</description>
<type>checkbutton</type>
<id>401</id>
<label>6016</label>
<onleft>13</onleft>
<onright>13</onright>
<onup>43</onup>
<ondown>402</ondown>
<textureCheckmark>check-box.png</textureCheckmark>
<textureCheckmarkNoFocus>check-boxNF.png</textureCheckmarkNoFocus>
<markWidth>16</markWidth>
<markHeight>16</markHeight>
<markXOff>20</markXOff>
<markalign>right</markalign>
<markvalign>middle</markvalign>
<height>34</height>
<width>995</width>
<font>menu</font>
<textcolor>#buttonTextColor</textcolor>
<textalign>left</textalign>
<textvalign>middle</textvalign>
<textXOff>10</textXOff>
<textureFocus border="1" position="inside" colorKey="66FFFFFF">list-focus.png</textureFocus>
<textureNoFocus>list-nofocus.png</textureNoFocus>
</control>
United States of America