void test_slider_torture() {
    GSlider *slider = new GSlider(0, 500, 250);
    slider->setLocation(gw->getWidth()/2, gw->getHeight()/2);
    gw->add(slider);
    for (int i = 0; i < 10000; i++) {
        int value = randomInteger(0, 500);
        slider->setValue(value);
        int gotValue = slider->getValue();
        if (value != gotValue) {
            cout << "oops" << endl;
            break;
        }
    }
}
示例#2
0
	void CNetRoomSettingHelper::setupNormalModeUI()
	{
		GSlider* slider = mSettingPanel->addSlider( UI_GRAVITY_LEVEL_SLIDER , LAN("Gravity Level") , MASK_MODE );
		slider->setRange( 0 , 500 );
		slider->setValue( mInfo.modeNormal.startGravityLevel );
	}