Example #1
0
/////////////////// <RANGE CONTROL>
    void PropertyGridManager::buildRangeControl(MyGUI::Widget *const control, PropertyGridProperty *const property)
    {
        int left = insertPropertyIdLabel(control, property) ;

        // scrollbar in between
        int width = control->getWidth() - left - WIDGET_SPACING * 2;
        MyGUI::IntCoord coord(left + WIDGET_SPACING, 1, width, control->getHeight() - 2);
        MyGUI::ScrollBar *scrollBar = (MyGUI::ScrollBar *)control->createWidget<MyGUI::ScrollBar>("SliderH", coord, MyGUI::Align::Left | MyGUI::Align::Top, "ScrollBar");
        scrollBar->setEnabled(!property->isReadOnly());
        MyGUIUtils::expandWidgetCoord(control, 0, 0, 0, 2);

        scrollBar->setScrollRange(100);
        scrollBar->setUserData(property);
        static_cast<MyGUI::ScrollBar *>(scrollBar)->eventScrollChangePosition += MyGUI::newDelegate(this, &PropertyGridManager::onMyGUIScrollChangePosition);


        MyGUI::TextBox *labelPtr;

        // label for min value
        left = insertLabel(control, "minLabel", "0.000", scrollBar->getLeft() + WIDGET_SPACING, labelPtr);
        labelPtr->setAlign(MyGUI::Align::Left | MyGUI::Align::VCenter);
        labelPtr->setNeedMouseFocus(false);
        labelPtr->setTextAlign(MyGUI::Align::Left);
        labelPtr->setTextColour(MyGUI::Colour::Black);

        // label for max value
        insertLabel(control, "maxLabel", "0.000", scrollBar->getRight() - labelPtr->getWidth() - WIDGET_SPACING, labelPtr); // built right after the minLabel
        labelPtr->setAlign(MyGUI::Align::Right | MyGUI::Align::VCenter);
        labelPtr->setNeedMouseFocus(false);
        labelPtr->setTextAlign(MyGUI::Align::Right);
        labelPtr->setTextColour(MyGUI::Colour::Black);

        // label for value
        insertLabel(control, "valueLabel", "0.000", (scrollBar->getLeft() + scrollBar->getRight()) / 2, labelPtr); // built right after the minLabel
        labelPtr->setAlign(MyGUI::Align::Center);
        labelPtr->setNeedMouseFocus(false);
        labelPtr->setTextAlign(MyGUI::Align::Center);
        labelPtr->setTextColour(MyGUI::Colour::Black);
    }
Example #2
0
/*!
\brief common section to return from a method

If the helper switch is on, this will generate a helper function
*/
int common_returnFromMethod() {
#if defined(ENABLE_TRACING) && !defined(TRACING_OPTION2)
    insertMapWorklist(offsetPC, mapFromBCtoNCG[offsetPC], 1); //check when helper switch is on
#endif

    scratchRegs[0] = PhysicalReg_SCRATCH_7;
    get_self_pointer(2, false);

    //update rFP to caller stack frame
    move_reg_to_reg(OpndSize_32, PhysicalReg_FP, true, 10, false);
    move_mem_to_reg(OpndSize_32, -sizeofStackSaveArea+offStackSaveArea_prevFrame, PhysicalReg_FP, true, PhysicalReg_FP, true); //update rFP
    //get caller method by accessing the stack save area
    move_mem_to_reg(OpndSize_32, -sizeofStackSaveArea+offStackSaveArea_method, PhysicalReg_FP, true, 6, false);
    compare_imm_reg(OpndSize_32, 0, 6, false);
    conditional_jump(Condition_E, "common_gotoBail_0", false);
    get_self_pointer(3, false);
    //update glue->method
    move_reg_to_mem(OpndSize_32, 6, false, offsetof(Thread, interpSave.method), 2, false);
    //get clazz of caller method
    move_mem_to_reg(OpndSize_32, offMethod_clazz, 6, false, 14, false);
    //update self->frame
    move_reg_to_mem(OpndSize_32, PhysicalReg_FP, true, offThread_curFrame, 3, false);
    //get method->clazz->pDvmDex
    move_mem_to_reg(OpndSize_32, offClassObject_pDvmDex, 14, false, 7, false);
    move_reg_to_mem(OpndSize_32, 7, false, offsetof(Thread, interpSave.methodClassDex), 2, false);

    compare_imm_mem(OpndSize_32, 0, offsetof(Thread, suspendCount), 2, false); /* suspendCount */
    move_mem_to_reg(OpndSize_32, -sizeofStackSaveArea+offStackSaveArea_returnAddr, 10, false, PhysicalReg_EBX, true);
    move_imm_to_reg(OpndSize_32, 0, 17, false);
    /* if suspendCount is not zero, clear the chaining cell address */
    conditional_move_reg_to_reg(OpndSize_32, Condition_NZ, 17, false/*src*/, PhysicalReg_EBX, true/*dst*/);
    move_mem_to_reg(OpndSize_32, -sizeofStackSaveArea+offStackSaveArea_savedPc, 10, false, PhysicalReg_EAX, true);
    //if returnAddr is not NULL, the thread is still in code cache
    move_reg_to_mem(OpndSize_32, PhysicalReg_EBX, true, offThread_inJitCodeCache, 3, false);

    insertLabel(".LreturnToInterp", true); //local label
    //move rPC by 6 (3 bytecode units for INVOKE)
    alu_binary_imm_reg(OpndSize_32, add_opc, 6, PhysicalReg_EAX, true);

    //returnAddr in %ebx, if not zero, jump to returnAddr
    compare_imm_reg(OpndSize_32, 0, PhysicalReg_EBX, true);
    conditional_jump(Condition_E, ".LcontinueToInterp", true);
#ifdef DEBUG_CALL_STACK3
    move_reg_to_reg(OpndSize_32, PhysicalReg_EBX, true, PhysicalReg_ESI, true);
    move_imm_to_reg(OpndSize_32, 0xaabb, PhysicalReg_EBX, true);
    scratchRegs[0] = PhysicalReg_EAX;
    call_debug_dumpSwitch(); //%ebx, %eax, %edx
    move_reg_to_reg(OpndSize_32, PhysicalReg_ESI, true, PhysicalReg_EBX, true);
    call_debug_dumpSwitch();
    move_reg_to_reg(OpndSize_32, PhysicalReg_ESI, true, PhysicalReg_EBX, true);
#endif
    unconditional_jump_reg(PhysicalReg_EBX, true);
    insertLabel(".LcontinueToInterp", true);
    scratchRegs[0] = PhysicalReg_SCRATCH_4;
    typedef void (*vmHelper)(int);
    vmHelper funcPtr = dvmJitToInterpNoChainNoProfile; //%eax is the input
    move_imm_to_reg(OpndSize_32, (int)funcPtr, C_SCRATCH_1, isScratchPhysical);

    unconditional_jump_reg(C_SCRATCH_1, isScratchPhysical);
    touchEax();
    return 0;
}
Example #3
0
bool CodeStack::insert(const std::string& label, const Code& code) {
	if (! insert(code) ) return false;
	if (! insertLabel(label)) return false;
	return true;
}
Example #4
0
 int PropertyGridManager::insertPropertyIdLabel(MyGUI::Widget *const control, PropertyGridProperty *const property)
 {
     return insertLabel(control, "IdLabel", property->id() + ":", control->getLeft());
 }