Use the already existing mScrollPage as step size for scrollbar button repeats; increased precision of options menu sliders

actorid
scrawl 12 years ago
parent 5c8950f91c
commit 58fce74620

@ -23,9 +23,9 @@ namespace MWGui
mTimeLeft = mInit; mTimeLeft = mInit;
mTimeLeft -= _time; mTimeLeft -= _time;
if(mTimeLeft <= 0) while (mTimeLeft <= 0)
{ {
mTimeLeft = mStep; mTimeLeft += mStep;
eventRepeatClick(_widget, this); eventRepeatClick(_widget, this);
} }
return true; return true;

@ -899,7 +899,6 @@ namespace MWGui
: mEnableRepeat(true) : mEnableRepeat(true)
, mRepeatTriggerTime(0.5) , mRepeatTriggerTime(0.5)
, mRepeatStepTime(0.1) , mRepeatStepTime(0.1)
, mStepSize(0)
{ {
} }
@ -945,21 +944,9 @@ namespace MWGui
mRepeatStepTime = step; mRepeatStepTime = step;
} }
void MWScrollBar::setStepSize(int step)
{
mStepSize = step;
}
int MWScrollBar::getStepSize()
{
return mStepSize;
}
void MWScrollBar::repeatClick(MyGUI::Widget* _widget, MyGUI::ControllerItem* _controller) void MWScrollBar::repeatClick(MyGUI::Widget* _widget, MyGUI::ControllerItem* _controller)
{ {
int stepSize = mStepSize; int stepSize = mScrollPage;
if(stepSize == 0)
stepSize = mScrollRange/20;
if(mIsIncreasing && mScrollPosition < mScrollRange-1) if(mIsIncreasing && mScrollPosition < mScrollRange-1)
{ {

@ -422,8 +422,6 @@ namespace MWGui
bool getEnableRepeat(); bool getEnableRepeat();
void getRepeat(float &trigger, float &step); void getRepeat(float &trigger, float &step);
void setRepeat(float trigger, float step); void setRepeat(float trigger, float step);
void setStepSize(int step);
int getStepSize();
protected: protected:
virtual void initialiseOverride(); virtual void initialiseOverride();
@ -433,7 +431,6 @@ namespace MWGui
float mRepeatTriggerTime; float mRepeatTriggerTime;
float mRepeatStepTime; float mRepeatStepTime;
bool mIsIncreasing; bool mIsIncreasing;
int mStepSize;
private: private:
void onDecreaseButtonPressed(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id); void onDecreaseButtonPressed(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id);

@ -16,7 +16,8 @@
<Property key="Caption" value="#{sTransparency_Menu}"/> <Property key="Caption" value="#{sTransparency_Menu}"/>
</Widget> </Widget>
<Widget type="MWScrollBar" skin="MW_HScroll" position="4 28 352 18" align="Left Top" name="MenuTransparencySlider"> <Widget type="MWScrollBar" skin="MW_HScroll" position="4 28 352 18" align="Left Top" name="MenuTransparencySlider">
<Property key="Range" value="100"/> <Property key="Range" value="10000"/>
<Property key="Page" value="300"/>
</Widget> </Widget>
<Widget type="TextBox" skin="SandText" position="4 52 352 18" align="Left Top"> <Widget type="TextBox" skin="SandText" position="4 52 352 18" align="Left Top">
<Property key="Caption" value="#{sFull}"/> <Property key="Caption" value="#{sFull}"/>
@ -31,7 +32,8 @@
<Property key="Caption" value="#{sMenu_Help_Delay}"/> <Property key="Caption" value="#{sMenu_Help_Delay}"/>
</Widget> </Widget>
<Widget type="MWScrollBar" skin="MW_HScroll" position="4 102 352 18" align="Left Top" name="ToolTipDelaySlider"> <Widget type="MWScrollBar" skin="MW_HScroll" position="4 102 352 18" align="Left Top" name="ToolTipDelaySlider">
<Property key="Range" value="100"/> <Property key="Range" value="10000"/>
<Property key="Page" value="300"/>
</Widget> </Widget>
<Widget type="TextBox" skin="SandText" position="4 126 352 18" align="Left Top"> <Widget type="TextBox" skin="SandText" position="4 126 352 18" align="Left Top">
<Property key="Caption" value="#{sFast}"/> <Property key="Caption" value="#{sFast}"/>
@ -65,35 +67,40 @@
<Property key="Caption" value="#{sMaster}"/> <Property key="Caption" value="#{sMaster}"/>
</Widget> </Widget>
<Widget type="MWScrollBar" skin="MW_HScroll" position="4 28 352 18" align="Left Top" name="MasterVolume"> <Widget type="MWScrollBar" skin="MW_HScroll" position="4 28 352 18" align="Left Top" name="MasterVolume">
<Property key="Range" value="100"/> <Property key="Range" value="10000"/>
<Property key="Page" value="300"/>
</Widget> </Widget>
<Widget type="TextBox" skin="NormalText" position="4 54 352 18" align="Left Top"> <Widget type="TextBox" skin="NormalText" position="4 54 352 18" align="Left Top">
<Property key="Caption" value="#{sVoice}"/> <Property key="Caption" value="#{sVoice}"/>
</Widget> </Widget>
<Widget type="MWScrollBar" skin="MW_HScroll" position="4 78 352 18" align="Left Top" name="VoiceVolume"> <Widget type="MWScrollBar" skin="MW_HScroll" position="4 78 352 18" align="Left Top" name="VoiceVolume">
<Property key="Range" value="100"/> <Property key="Range" value="10000"/>
<Property key="Page" value="300"/>
</Widget> </Widget>
<Widget type="TextBox" skin="NormalText" position="4 104 352 18" align="Left Top"> <Widget type="TextBox" skin="NormalText" position="4 104 352 18" align="Left Top">
<Property key="Caption" value="#{sEffects}"/> <Property key="Caption" value="#{sEffects}"/>
</Widget> </Widget>
<Widget type="MWScrollBar" skin="MW_HScroll" position="4 128 352 18" align="Left Top" name="EffectsVolume"> <Widget type="MWScrollBar" skin="MW_HScroll" position="4 128 352 18" align="Left Top" name="EffectsVolume">
<Property key="Range" value="100"/> <Property key="Range" value="10000"/>
<Property key="Page" value="300"/>
</Widget> </Widget>
<Widget type="TextBox" skin="NormalText" position="4 154 352 18" align="Left Top"> <Widget type="TextBox" skin="NormalText" position="4 154 352 18" align="Left Top">
<Property key="Caption" value="#{sFootsteps}"/> <Property key="Caption" value="#{sFootsteps}"/>
</Widget> </Widget>
<Widget type="MWScrollBar" skin="MW_HScroll" position="4 178 352 18" align="Left Top" name="FootstepsVolume"> <Widget type="MWScrollBar" skin="MW_HScroll" position="4 178 352 18" align="Left Top" name="FootstepsVolume">
<Property key="Range" value="100"/> <Property key="Range" value="10000"/>
<Property key="Page" value="300"/>
</Widget> </Widget>
<Widget type="TextBox" skin="NormalText" position="4 204 352 18" align="Left Top"> <Widget type="TextBox" skin="NormalText" position="4 204 352 18" align="Left Top">
<Property key="Caption" value="#{sMusic}"/> <Property key="Caption" value="#{sMusic}"/>
</Widget> </Widget>
<Widget type="MWScrollBar" skin="MW_HScroll" position="4 228 352 18" align="Left Top" name="MusicVolume"> <Widget type="MWScrollBar" skin="MW_HScroll" position="4 228 352 18" align="Left Top" name="MusicVolume">
<Property key="Range" value="100"/> <Property key="Range" value="10000"/>
<Property key="Page" value="300"/>
</Widget> </Widget>
</Widget> </Widget>
<Widget type="TabItem" skin="" position="4 28 360 312"> <Widget type="TabItem" skin="" position="4 28 360 312">
@ -118,7 +125,8 @@
<Property key="Caption" value="Camera sensitivity"/> <Property key="Caption" value="Camera sensitivity"/>
</Widget> </Widget>
<Widget type="MWScrollBar" skin="MW_HScroll" position="4 252 336 18" align="Left Top" name="CameraSensitivitySlider"> <Widget type="MWScrollBar" skin="MW_HScroll" position="4 252 336 18" align="Left Top" name="CameraSensitivitySlider">
<Property key="Range" value="100"/> <Property key="Range" value="10000"/>
<Property key="Page" value="300"/>
</Widget> </Widget>
<Widget type="TextBox" skin="SandText" position="4 276 336 18" align="Left Top"> <Widget type="TextBox" skin="SandText" position="4 276 336 18" align="Left Top">
<Property key="Caption" value="#{sLow}"/> <Property key="Caption" value="#{sLow}"/>
@ -183,7 +191,8 @@
<Property key="Caption" value="Field of View"/> <Property key="Caption" value="Field of View"/>
</Widget> </Widget>
<Widget type="MWScrollBar" skin="MW_HScroll" position="4 222 329 18" align="Left Top" name="FOVSlider"> <Widget type="MWScrollBar" skin="MW_HScroll" position="4 222 329 18" align="Left Top" name="FOVSlider">
<Property key="Range" value="100"/> <Property key="Range" value="10000"/>
<Property key="Page" value="300"/>
</Widget> </Widget>
<Widget type="TextBox" skin="SandText" position="4 246 329 18" align="Left Top"> <Widget type="TextBox" skin="SandText" position="4 246 329 18" align="Left Top">
<Property key="Caption" value="#{sLow}"/> <Property key="Caption" value="#{sLow}"/>
@ -208,7 +217,8 @@
<Property key="Caption" value="Anisotropy"/> <Property key="Caption" value="Anisotropy"/>
</Widget> </Widget>
<Widget type="MWScrollBar" skin="MW_HScroll" position="0 28 150 18" align="Left Top" name="AnisotropySlider"> <Widget type="MWScrollBar" skin="MW_HScroll" position="0 28 150 18" align="Left Top" name="AnisotropySlider">
<Property key="Range" value="100"/> <Property key="Range" value="10000"/>
<Property key="Page" value="300"/>
</Widget> </Widget>
</Widget> </Widget>
@ -216,7 +226,8 @@
<Property key="Caption" value="#{sRender_Distance}"/> <Property key="Caption" value="#{sRender_Distance}"/>
</Widget> </Widget>
<Widget type="MWScrollBar" skin="MW_HScroll" position="4 154 322 18" align="Left Top" name="ViewDistanceSlider"> <Widget type="MWScrollBar" skin="MW_HScroll" position="4 154 322 18" align="Left Top" name="ViewDistanceSlider">
<Property key="Range" value="100"/> <Property key="Range" value="10000"/>
<Property key="Page" value="300"/>
</Widget> </Widget>
<Widget type="TextBox" skin="SandText" position="4 178 332 18" align="Left Top"> <Widget type="TextBox" skin="SandText" position="4 178 332 18" align="Left Top">
<Property key="Caption" value="#{sNear}"/> <Property key="Caption" value="#{sNear}"/>

Loading…
Cancel
Save