View Single Post
05-30-09, 09:01 PM   #2
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
Answer to your PM:

Originally Posted by Samsan View Post
1. Show or hide minimap button.....
The code:

Code:
            <OnClick>
                if DWMPackMinimapButton.ShowMinimapButtonCheckButton then
                    DWMPackMinimapButton.ShowMinimapButtonCheckButton = false
                    DWMPackMinimapButton:Hide()
                else
                    DWMPackMinimapButton.ShowMinimapButtonCheckButton = true
                    DWMPackMinimapButton:Show()
                end
                self:SetChecked(DWMPackMinimapButton.ShowMinimapButtonCheckButton)
            </OnClick>
Lemme ask you this: when you click the button does it always stay checked?

2. Lock/Unlock the frame.... I can lock or unlock the frame ok buut it clings to the cursor and you have to click it twice as per above to unlock it.

The code:
Code:
            <OnClick>
                if DWMPackBaseFrame.FrameLockCheckButton then
                    DWMPackBaseFrame.FrameLockCheckButton = false
                    DWMPackBaseFrame:StartMoving();
                else
                    DWMPackBaseFrame.FrameLockCheckButton = true
                    DWMPackBaseFrame:StopMovingOrSizing();
                end
                self:SetChecked(DWMPackBaseFrame.FrameLockCheckButton)
            </OnClick>
I know something is wrong here, but I can't put my finger on it at the moment. Hmmm....

3. Sliders... Scale slider

The scale slider only has 2 settings so it seems, 100% and 50% even though it has a step value of 1. When you go to adjust it, it jumps to 50% and won't move via increments like it should.

The code:
Code:
      <Frame name="FrameScaleSlider">
        <Size>
          <AbsDimension x="232" y="50" />
        </Size>
        <Anchors>
          <Anchor point="TOPLEFT">
            <Offset>
              <AbsDimension x="3" y="-214" />
            </Offset>
          </Anchor>
        </Anchors>
        <Frames>
          <Slider name="FSSlider" enableMouse="true" minValue="50" maxValue="100" defaultValue="100" valueStep="1" orientation="HORIZONTAL">
            <Size>
              <AbsDimension x="128" y="17" />
            </Size>
            <Anchors>
              <Anchor point="LEFT" />
              <Anchor point="RIGHT" />
            </Anchors>
            <Scripts>
                <OnValueChanged>
                    DWMPackBaseFrame:SetScale(value / 100);
                </OnValueChanged>
            </Scripts>
            <Backdrop bgFile="Interface\Buttons\UI-SliderBar-Background" edgeFile="Interface\Buttons\UI-SliderBar-Border" tile="true">
              <BackgroundInsets>
                <AbsInset left="3" right="3" top="6" bottom="6" />
              </BackgroundInsets>
              <TileSize>
                <AbsValue val="8" />
              </TileSize>
              <EdgeSize>
                <AbsValue val="8" />
              </EdgeSize>
            </Backdrop>
            <Layers>
              <Layer>
                <FontString name="$parentTitle" font="Fonts\FRIZQT__.TTF" text="Sets Frame Size">
                  <Anchors>
                    <Anchor point="BOTTOM" relativePoint="TOP" />
                  </Anchors>
                  <FontHeight>
                    <AbsValue val="10" />
                  </FontHeight>
                  <Color r="1" g="0.8196079" b="0" />
                  <Shadow>
                    <Color r="0" g="0" b="0" />
                    <Offset>
                      <AbsDimension x="1" y="-1" />
                    </Offset>
                  </Shadow>
                </FontString>
                <FontString name="$parentLow" font="Fonts\FRIZQT__.TTF" text="50%">
                  <Anchors>
                    <Anchor point="TOPLEFT" relativePoint="BOTTOMLEFT" />
                  </Anchors>
                  <FontHeight>
                    <AbsValue val="10" />
                  </FontHeight>
                  <Color r="1" g="1" b="1" />
                  <Shadow>
                    <Color r="0" g="0" b="0" />
                    <Offset>
                      <AbsDimension x="1" y="-1" />
                    </Offset>
                  </Shadow>
                </FontString>
                <FontString name="$parentHigh" font="Fonts\FRIZQT__.TTF" text="100%">
                  <Anchors>
                    <Anchor point="TOPRIGHT" relativePoint="BOTTOMRIGHT" />
                  </Anchors>
                  <FontHeight>
                    <AbsValue val="10" />
                  </FontHeight>
                  <Color r="1" g="1" b="1" />
                  <Shadow>
                    <Color r="0" g="0" b="0" />
                    <Offset>
                      <AbsDimension x="1" y="-1" />
                    </Offset>
                  </Shadow>
                </FontString>
              </Layer>
            </Layers>
            <ThumbTexture name="$parentThumb" file="Interface\Buttons\UI-SliderBar-Button-Horizontal">
              <Size>
                <AbsDimension x="32" y="32" />
              </Size>
            </ThumbTexture>
          </Slider>
Honestly, I tried to work with sliders/scroll frames and just couldn't get it to work correctly either. I wound up simply using the Faux template for scroll frames.

Keep in mind that I'm not savvy with XML really. I found it too much of a hassle (as you're learning I see) and went to strictly LUA. At least that way it would spit errors with line references where as XML will simply just not work.
  Reply With Quote