bool iDefaultCallback_onMouseMove(SWindow* win, SObject* obj, SVariable* varX, SVariable* varY, SVariable* varCtrl, SVariable* varAlt, SVariable* varShift, SVariable* varClick) { f64 lfPercent, lfX, lfY, lfWidth, lfHeight; s32 lnX, lnY; u32 lnClick; bool llCtrl, llAlt, llShift; SVariable* valueMin; // Make sure our environment is sane if (!iiDefaultCallback_processMouseVariables(varX, varY, varCtrl, varAlt, varShift, varClick, &lnX, &lnY, &llCtrl, &llAlt, &llShift, &lnClick)) return(false); // Do not continue consuming // If we're clicking on a radio button, adjust the dial if (lnClick != 0 && obj->objType == _OBJ_TYPE_RADIO) { // The mouse indicates the position // Determine theta lfWidth = (f64)(obj->rc.right - obj->rc.left); lfHeight = (f64)(obj->rc.bottom - obj->rc.top); lfX = (f64)lnX - (lfWidth / 2.0); lfY = (lfHeight - (f64)lnY) - (lfHeight / 2.0); lfPercent = atan2(lfY, lfX) / (M_PI * 2.0); if (lfPercent < 0.0) lfPercent += 1.0; valueMin = iObjProp_get_var_byIndex(obj, _INDEX_VALUE_MINIMUM); iObjProp_set_f64_direct(obj, _INDEX_VALUE, get_f64(valueMin) + (lfPercent * (iObjProp_get_f64_direct(obj, _INDEX_VALUE_MAXIMUM) - get_f64(valueMin)))); iObj_setDirtyRender_ascent(obj, true); iWindow_render(win, false); } else if (obj->objType == _OBJ_TYPE_EDITBOX) { if ((lnClick & _MOUSE_LEFT_BUTTON) != 0) { // They are clicking and dragging // Need to navigate to the indicated x,y coordinate iSEM_navigateTo_pixelXY(obj->p.sem, obj, lnX, lnY); // Mark the mouse activity iSEM_selectStart(obj->p.sem, _SEM_SELECT_MODE_ANCHOR); // Redraw our changes iObj_setDirtyRender_ascent(obj, true); iWindow_render(win, false); } } else if (obj->objType == _OBJ_TYPE_CAROUSEL) { // We always track mouse movements to hightlight and un-hightlight tabs return(iEvents_carouselMouseMove(win, obj, lnX, lnY, llCtrl, llAlt, llShift, lnClick)); } // Mouse moves continue to propagate all the way through, so as to signal appropriate enter and leave events return(true); }
bool iDefaultCallback_onMouseUp(SWindow* win, SObject* obj, SVariable* varX, SVariable* varY, SVariable* varCtrl, SVariable* varAlt, SVariable* varShift, SVariable* varClick) { s32 lnX, lnY; u32 lnClick; bool llCtrl, llAlt, llShift; POINT pt; // Make sure our environment is sane if (!iiDefaultCallback_processMouseVariables(varX, varY, varCtrl, varAlt, varShift, varClick, &lnX, &lnY, &llCtrl, &llAlt, &llShift, &lnClick)) return(false); // Do not continue consuming if (obj->objType == _OBJ_TYPE_CAROUSEL) { // Create a point pt.x = lnX; pt.y = lnY; // They are they outside of the client area? if (!PtInRect(&obj->rcClient, pt)) return(iEvents_carouselMouseUp(win, obj, lnX, lnY, llCtrl, llAlt, llShift, lnClick)); } // We are leaving this object, lower the flag obj->ev.isMouseDown = (obj->ev.thisClick != 0); // Indicate if the mouse is down here obj->ev.isMouseDown = false; iObj_setDirtyRender_ascent(obj, true); iWindow_render(win, false); // Do not continue to propagate this message to other objects return(false); }
////////// // // Called when the user mouse ups (releases the mouse button) on a carousel somewhere outside of the client area // ////// bool iEvents_carouselMouseUp(SThisCode* thisCode, SWindow* win, SObject* obj, s32 lnX, s32 lnY, bool llCtrl, bool llAlt, bool llShift, u32 lnClick) { u32 lnTarget; bool llFocusChanged, llResult; SObjCarouselTabData* octd; // Make sure our environment is sane llResult = true; if (obj) { // Find the associated carousel sub-object lnTarget = iiEvents_carousel_findTarget(thisCode, win, obj, lnX, lnY, &octd, &llFocusChanged); switch (lnTarget) { case _EVENT_CAROUSEL_TAB: // Releasing the mouse on a tab iEngine_raise_event(thisCode, _EVENT_CAROUSEL_ONTABMOUSEUP, win, obj, (void*)false); llResult = false; break; } } // If something changed, we need to re-render if (llFocusChanged) { iObj_setDirtyRender_ascent(thisCode, obj, true); iWindow_render(thisCode, iWindow_findRoot_byObj(thisCode, obj), false); } // Signal if the message should continue propagating return(llResult); }
bool iDefaultCallback_onMouseLeave(SWindow* win, SObject* obj) { // Assume we consumed the leave, and that the parent doesn't need to receive it if (obj->ev.isMouseOver) { obj->ev.isMouseOver = false; iObj_setDirtyRender_ascent(obj, true); iWindow_render(win, false); } // Do not continue to propagate this message to other objects return(false); }
bool iDefaultCallback_onMouseEnter(SWindow* win, SObject* obj) { // We are newly over this object, raise the flag obj->ev.isMouseDown = (obj->ev.thisClick != 0); // Indicate if the mouse is down here if (!obj->ev.isMouseOver) { obj->ev.isMouseOver = true; iObj_setDirtyRender_ascent(obj, true); iWindow_render(win, false); } // Do not continue to propagate this message to other objects return(false); }
bool iDefaultCallback_onMouseWheel(SWindow* win, SObject* obj, SVariable* varX, SVariable* varY, SVariable* varCtrl, SVariable* varAlt, SVariable* varShift, SVariable* varClick, SVariable* varUnits) { s32 lnX, lnY, lnUnits; u32 lnClick; bool llCtrl, llAlt, llShift; // POINT pt; // Make sure our environment is sane if (!iiDefaultCallback_processMouseVariables(varX, varY, varCtrl, varAlt, varShift, varClick, &lnX, &lnY, &llCtrl, &llAlt, &llShift, &lnClick) || !iVariable_isValid(varUnits) || !iVariable_isTypeNumeric(varUnits)) return(false); // Do not continue consuming // Grab the units lnUnits = iiVariable_getAs_s32(varUnits, false, NULL, NULL); // Assume we consumed the mouse wheel, and that the parent doesn't need to receive it if (obj->objType == _OBJ_TYPE_EDITBOX) { // Ctrl+MouseWheel is a normal navigate if (llCtrl) { // They are just moving the cursor line iSEM_navigate(obj->p.sem, obj, lnUnits * ((llShift) ? -1 : -3), 0); // MouseWheel is a scroll } else { // They want to scroll the entire window, including the cursor line iSEM_scroll(obj->p.sem, obj, lnUnits * ((llShift) ? -1 : -3), 0); } iObj_setDirtyRender_ascent(obj, true); iWindow_render(win, false); } else if (obj->objType == _OBJ_TYPE_CAROUSEL) { // Create a point // pt.x = lnX; // pt.y = lnY; // They are they outside of the client area? return(iEvents_carouselMouseWheel(win, obj, lnX, lnY, llCtrl, llAlt, llShift, lnClick)); } else { // Continue propagating return(true); } // Do not continue to propagate this message to other objects return(false); }
bool iDefaultCallback_onKeyDown(SWindow* win, SObject* obj, SVariable* varCtrl, SVariable* varAlt, SVariable* varShift, SVariable* varCaps, SVariable* varAscii, SVariable* varVKey, SVariable* varIsCAS, SVariable* varIsAscii) { bool llRender; SObject* objCheckbox; SObject* objRender2; bool llCtrl, llAlt, llShift, llCaps, llIsCAS, llIsAscii; s16 lcAscii; u16 lnVKey; // Make sure our environment is sane if (!iiDefaultCallback_processKeyVariables(varCtrl, varAlt, varShift, varCaps, varAscii, varVKey, varIsCAS, varIsAscii, &llCtrl, &llAlt, &llShift, &llCaps, &llIsCAS, &llIsAscii, &lcAscii, &lnVKey)) return(false); // Do not continue consuming ////////// // See if we're on a checkbox ////// llRender = false; objCheckbox = NULL; if (obj->objType == _OBJ_TYPE_CHECKBOX) { // The object itself is a checkbox objCheckbox = obj; objRender2 = obj; } else if (obj->parent && obj->parent->objType == _OBJ_TYPE_CHECKBOX) { // The parent is a checkbox objCheckbox = obj->parent; objRender2 = obj; } if (objCheckbox) { if (lnVKey == VK_SPACE || lnVKey == VK_RETURN) { // Toggle the value and redraw llRender = true; iObjProp_set_s32_direct(objCheckbox, _INDEX_VALUE, ((iObjProp_get_s32_direct(objCheckbox, _INDEX_VALUE) == 0) ? 1 : 0)); iObj_setDirtyRender_ascent(objCheckbox, false); if (objRender2 != objCheckbox) iObj_setDirtyRender_ascent(objRender2, false); } else if (llShift && lnVKey == VK_TAB) { // Move to previous object llRender = iObj_setFocusObjectPrev(win, objCheckbox); } else if (lnVKey == VK_TAB) { // Move to next object llRender = iObj_setFocusObjectNext(win, objCheckbox); } else if (llIsAscii) { if ((u8)lcAscii == 't' || (u8)lcAscii == 'T' || (u8)lcAscii == 'y' || (u8)lcAscii == 'Y' || (u8)lcAscii == '1') { // Set it to on llRender = true; iObjProp_set_s32_direct(obj, _INDEX_VALUE, 1); iObj_setDirtyRender_ascent(objCheckbox, false); if (objRender2 != objCheckbox) iObj_setDirtyRender_ascent(objRender2, false); } else if ((u8)lcAscii == 'f' || (u8)lcAscii == 'F' || (u8)lcAscii == 'n' || (u8)lcAscii == 'N' || (u8)lcAscii == '0') { // Set it to off llRender = true; iObjProp_set_s32_direct(obj, _INDEX_VALUE, 0); iObj_setDirtyRender_ascent(objCheckbox, false); if (objRender2 != objCheckbox) iObj_setDirtyRender_ascent(objRender2, false); } } } else { // Not a checkbox if (llShift && lnVKey == VK_TAB) { // Move to previous object llRender = iObj_setFocusObjectPrev(win, obj); } else if (lnVKey == VK_TAB) { // Move to next object llRender = iObj_setFocusObjectNext(win, obj); } } // Redraw if need be if (llRender) { // Redraw the checkbox if needed if (objCheckbox) iObj_setSize(objCheckbox, objCheckbox->rc.left, objCheckbox->rc.top, objCheckbox->rc.right - objCheckbox->rc.left, objCheckbox->rc.bottom - objCheckbox->rc.top); // Redraw the window iWindow_render(win, false); } // Do not continue to propagate this message to other objects return(false); }
bool iDefaultCallback_onMouseDown(SWindow* win, SObject* obj, SVariable* varX, SVariable* varY, SVariable* varCtrl, SVariable* varAlt, SVariable* varShift, SVariable* varClick) { bool llMouseDown, llResult, llFocusChanged; f64 lfPercent, lfX, lfY, lfWidth, lfHeight, lfValue; s32 lnX, lnY; u32 lnClick; bool llCtrl, llAlt, llShift; POINT pt; SVariable* valueMin; SObject* objRoot; // Make sure our environment is sane if (!iiDefaultCallback_processMouseVariables(varX, varY, varCtrl, varAlt, varShift, varClick, &lnX, &lnY, &llCtrl, &llAlt, &llShift, &lnClick)) return(false); // Do not continue consuming // Set the flags llMouseDown = true; llResult = true; // If focus isn't already set on this control, set focus on this control if (!obj->p.hasFocus) { objRoot = iObj_find_rootmostObject(obj); if (objRoot) iObj_clearFocus(win, objRoot, true, true); iObj_setFocus(win, obj, true); iObj_setDirtyRender_ascent(obj, true, true); llFocusChanged = true; } else { llFocusChanged = false; } // For forms, they can be clicking down on special things for various operations if (obj->parent && obj->parent->objType == _OBJ_TYPE_FORM && win->obj == obj->parent) { // Left button only? if (win->mouseCurrent.buttonLeft && !win->mouseCurrent.buttonMiddle && !win->mouseCurrent.buttonRight) { // We're on the top-level form for the window if (propIsName_byText(obj, cgcName_iconMove) || propIsName_byText(obj, cgcName_caption)) { // We're on the _move icon or the caption, which means they want to move the window win->isMoving = true; memcpy(&win->rcMoveResizeStart, &win->rc, sizeof(win->rcMoveResizeStart)); memcpy(&win->mouseMoveResizeStart, &win->mouseCurrent, sizeof(win->mouseMoveResizeStart)); // } else if (iDatum_compare(&varName->value, cgcName_iconScaleUl, sizeof(cgcName_iconScaleUl) - 1) == 0) { // // We're on the upper-left scaling arrow // } else if (iDatum_compare(&varName->value, cgcName_iconScaleUr, sizeof(cgcName_iconScaleUr) - 1) == 0) { // // We're on the upper-right scaling arrow // } else if (iDatum_compare(&varName->value, cgcName_iconScaleLr, sizeof(cgcName_iconScaleLr) - 1) == 0) { // // We're on the lower-right scaling arrow // } else if (iDatum_compare(&varName->value, cgcName_iconScaleLl, sizeof(cgcName_iconScaleLl) - 1) == 0) { // // We're on the lower-left scaling arrow } } } if (obj->parent && obj->parent->objType == _OBJ_TYPE_CHECKBOX) { // For checkboxes, we toggle // They're clicking on a checkbox, toggle the value and re-render iObjProp_set_s32_direct(obj->parent, _INDEX_VALUE, ((iObjProp_get_s32_direct(obj->parent, _INDEX_VALUE) != 0) ? 0 : 1)); // Force a refresh obj->parent->isDirtyRender = true; obj->parent->isDirtyPublish = true; // Do not continue to propagate llResult = false; } else if (obj->objType == _OBJ_TYPE_EDITBOX) { // Need to navigate to the indicated x,y coordinate iSEM_navigateTo_pixelXY(obj->p.sem, obj, lnX, lnY); // Mark the mouse activity if (!llShift) iSEM_selectStop(obj->p.sem); else iSEM_selectStart(obj->p.sem, _SEM_SELECT_MODE_ANCHOR); // Do not continue to propagate llResult = false; } else if (obj->objType == _OBJ_TYPE_RADIO) { // The mouse indicates the position // Determine theta lfWidth = (f64)(obj->rc.right - obj->rc.left); lfHeight = (f64)(obj->rc.bottom - obj->rc.top); lfX = (f64)lnX - (lfWidth / 2.0); lfY = (lfHeight - (f64)lnY) - (lfHeight / 2.0); lfPercent = atan2(lfY, lfX) / (M_PI * 2.0); if (lfPercent < 0.0) lfPercent += 1.0; valueMin = iObjProp_get_var_byIndex(obj, _INDEX_VALUE_MINIMUM); lfValue = get_f64(valueMin) + (lfPercent * (iObjProp_get_f64_direct(obj, _INDEX_VALUE_MAXIMUM) - get_f64(valueMin))); iObjProp_set_f64_direct(obj, _INDEX_VALUE, lfValue); // Do not continue to propagate llResult = false; } else if (obj->objType == _OBJ_TYPE_CAROUSEL) { // Create a point pt.x = lnX; pt.y = lnY; // They are they outside of the client area? if (!PtInRect(&obj->rcClient, pt)) return(iEvents_carouselMouseDown(win, obj, lnX, lnY, llCtrl, llAlt, llShift, lnClick)); } else { // Assume we consumed the mouse down event, and that the parent doesn't need to receive it switch (obj->objType) { case _OBJ_TYPE_IMAGE: if (propIsName_byText(obj, cgcName_iconClose)) { // Close iVjr_shutdown(); // They clicked quit return(false); // When we get here, the object no longer exists } else if (propIsName_byText(obj, cgcName_iconMove)) { // Move llMouseDown = false; obj->ev.isMouseOver = false; iWindow_move(win); } else if (propIsName_byText(obj, cgcName_iconMinimize)) { // Minimize llMouseDown = false; obj->ev.isMouseOver = false; iWindow_minimize(win); } else if (propIsName_byText(obj, cgcName_iconMaximize)) { // Maximize llMouseDown = false; obj->ev.isMouseOver = false; iWindow_maximize(win); } break; } } // Update our condition obj->ev.isMouseDown = llMouseDown; iObj_setDirtyRender_ascent(obj, true, true); iWindow_render(win, llFocusChanged); // Do not continue to propagate this message to other objects return(llResult); }
////////// // // Startup initialization, called from WinMain() only. // ////// void iVjr_init(HACCEL* hAccelTable) { SThisCode* thisCode = NULL; RECT lrc; #if !defined(_NONVJR_COMPILE) u8 logBuffer[256]; SBitmap* bmp; #if defined(_GRACE_COMPILE) SGraceParams params; #endif #endif // Get startup time systemStartedTickCount = GetTickCount(); systemStartedMs = iTime_getLocalMs(); // Fixup values that can't be properly encoded at compile-time iObjProp_init_fixup(); // Initialize basic data engine iDbf_startup(true); // Create a 1x1 no image bitmap placeholder bmpNoImage = iBmp_allocate(); iBmp_createBySize(bmpNoImage, 1, 1, 24); // Initialize primitive variables iVariable_createDefaultValues(NULL); iVariable_createPropsMaster(NULL); iVjr_init_createConstants(); // Initialize our critical sections InitializeCriticalSection(&cs_uniqueIdAccess); InitializeCriticalSection(&cs_logData); // These arrows are used as a standard throughout the system for the size of an icon. // They must be loaded first. bmpArrowUl = iBmp_rawLoad(cgc_arrowUlBmp); bmpArrowUr = iBmp_rawLoad(cgc_arrowUrBmp); bmpArrowLl = iBmp_rawLoad(cgc_arrowLlBmp); bmpArrowLr = iBmp_rawLoad(cgc_arrowLrBmp); // Initialize our builders iBuilder_createAndInitialize(&gWindows, -1); iBuilder_createAndInitialize(&gFonts, -1); // Default font gsFontDefault = iFont_create(cgcFontName_default, 10, FW_NORMAL, 0, 0); gsFontDefault9 = iFont_create(cgcFontName_default, 9, FW_NORMAL, 0, 0); gsFontDefaultBold = iFont_create(cgcFontName_default, 10, FW_BOLD, 0, 0); gsFontDefaultItalic8 = iFont_create(cgcFontName_default, 8, FW_NORMAL, 1, 0); gsFontDefaultFixedPoint = iFont_create(cgcFontName_defaultFixed, 10, FW_NORMAL, 0, 0); gsWindowTitleBarFont = iFont_create(cgcFontName_windowTitleBar, 12, FW_NORMAL, 0, 0); gsWindowTitleBarFontSubform = iFont_create(cgcFontName_windowTitleBar, 10, FW_NORMAL, 0, 0); gsFontDefaultTooltip = iFont_create(cgcFontName_defaultTooltip, 9, FW_BOLD, 0, 0); gsFontCask = iFont_create(cgcFontName_cask, 20, FW_BOLD, 0, 0); // Initialize the sound system isound_initialize(); memset(&gseRootSounds, 0, sizeof(gseRootSounds)); // Initialize our root sounds array ////////// // Jul.29.2014 // Removed due to limitations in the Shobjidl.h in MinGW. Can be manually re-added with copy-and-paste... enjoy doing that! :-) // // Taskbar interface // HRESULT hRes; // hRes = OleInitialize(NULL); // CoCreateInstance(CLSID_TaskbarList, 0, CLSCTX_INPROC_SERVER, IID_ITaskbarList, (void**)&giTaskbar); ////////// ////////// // Allocate a sourceLight area ////// bmpSourceLight = iBmp_allocate(); iBmp_createBySize(bmpSourceLight, 800, 1024, 24); iSourceLight_reset(); ////////// // Load our icons and images ////// bmpVjrIcon = iBmp_rawLoad(cgc_appIconBmp); bmpJDebiIcon = iBmp_rawLoad(cgc_jdebiAppIconBmp); bmpSourceCodeIcon = iBmp_rawLoad(cgc_sourcecodeIconBmp); bmpLocalsIcon = iBmp_rawLoad(cgc_localsIconBmp); bmpWatchIcon = iBmp_rawLoad(cgc_watchIconBmp); bmpCommandIcon = iBmp_rawLoad(cgc_commandIconBmp); bmpDebugIcon = iBmp_rawLoad(cgc_debugIconBmp); bmpOutputIcon = iBmp_rawLoad(cgc_outputIconBmp); bmpSourceLightIcon = iBmp_rawLoad(cgc_sourcelightIconBmp); // Carousels bmpCarouselCarouselIcon = iBmp_rawLoad(cgc_carouselCarouselBmp); bmpCarouselTabsIcon = iBmp_rawLoad(cgc_carouselTabsBmp); bmpCarouselPad = iBmp_rawLoad(cgc_carouselPadBmp); bmpCarouselIcon = iBmp_rawLoad(cgc_carouselIconBmp); bmpCarouselRiderTabClose = iBmp_rawLoad(cgc_carouselRiderTabCloseBmp); bmpClose = iBmp_rawLoad(cgc_closeBmp); bmpMaximize = iBmp_rawLoad(cgc_maximizeBmp); bmpMinimize = iBmp_rawLoad(cgc_minimizeBmp); bmpMove = iBmp_rawLoad(cgc_moveBmp); bmpCheckboxOn = iBmp_rawLoad(cgc_checkboxOnBmp); bmpCheckboxOff = iBmp_rawLoad(cgc_checkboxOffBmp); bmpButton = iBmp_rawLoad(cgc_buttonBmp); bmpTextbox = iBmp_rawLoad(cgc_textboxBmp); bmpStoplightRed = iBmp_rawLoad(cgc_stoplightRedBmp); bmpStoplightAmber = iBmp_rawLoad(cgc_stoplightAmberBmp); bmpStoplightGreen = iBmp_rawLoad(cgc_stoplightGreenBmp); bmpStoplightBlue = iBmp_rawLoad(cgc_stoplightBlueBmp); bmpBreakpointAlways = iBmp_rawLoad(cgc_breakpointAlways); bmpBreakpointAlwaysCountdown = iBmp_rawLoad(cgc_breakpointAlwaysCountdown); bmpConditionalTrue = iBmp_rawLoad(cgc_breakpointConditionalTrue); bmpConditionalFalse = iBmp_rawLoad(cgc_breakpointConditionalFalse); bmpConditionalTrueCountdown = iBmp_rawLoad(cgc_breakpointConditionalTrueCountdown); bmpConditionalFalseCountdown = iBmp_rawLoad(cgc_breakpointConditionalFalseCountdown); bmpDapple1 = iBmp_rawLoad(cgc_dappleBmp); bmpDapple1Tmp = iBmp_rawLoad(cgc_dappleBmp); bmpDapple2 = iBmp_rawLoad(cgc_dapple2Bmp); bmpDapple2Tmp = iBmp_rawLoad(cgc_dapple2Bmp); ////////// // Casks ////// iVjr_init_loadCaskIcons(); ////////// // Bitmap array ////// iVjr_init_loadBitmapArray(); ////////// // The radio image has a 44x44 dot in the upper-left. ////// bmpRadio = iBmp_rawLoad(cgc_radioBmp); // Load the raw bmpRadio bmpRadioDot = iBmp_createAndExtractRect(bmpRadio, 0, 0, 44, 44); // Extract the 44x44 rectangle SetRect(&lrc, 0, 0, 44, 44); iBmp_fillRect(bmpRadio, &lrc, whiteColor, whiteColor, whiteColor, whiteColor, false, NULL, false); // And cover it up with white ////////// // Splash screen ////// #if !defined(_NONVJR_COMPILE) // Load the splash screen if (glShowSplashScreen) { bmpVjrSplash = iBmp_rawLoad(cgc_splashBmp); bmp = iiVjr_buildSplashScreen(bmpVjrSplash); CreateThread(0, 0, &iSplash_show, bmp, 0, 0); } // Play the startup music if any sprintf((s8*)logBuffer, "VJr launched %u milliseconds after system boot\0", systemStartedTickCount); iVjr_appendSystemLog(thisCode, logBuffer); if (glShowSplashScreen) CreateThread(0, 0, &iPlay_ariaSplash, (LPVOID)cgcSoundStartupWav, 0, 0); #endif // Focus window accumulator #if !defined(_NONVJR_COMPILE) iVjr_appendSystemLog(thisCode, (u8*)"Create focus highlight buffer"); #endif iBuilder_createAndInitialize(&gFocusHighlights, -1); // Create the default reference datetimes #if !defined(_NONVJR_COMPILE) iVjr_appendSystemLog(thisCode, (u8*)"Create default datetime variables"); #endif iVjr_init_createDefaultDatetimes(); // Create our message window #if !defined(_NONVJR_COMPILE) iVjr_appendSystemLog(thisCode, (u8*)"Create message window"); #endif iVjr_init_createMessageWindow(); // Create our global variables #if !defined(_NONVJR_COMPILE) iVjr_appendSystemLog(thisCode, (u8*)"Create global and system variables"); #endif iVjr_init_createGlobalSystemVariables(); // Create our default objects #if !defined(_NONVJR_COMPILE) iVjr_appendSystemLog(thisCode, (u8*)"Create default objects"); #endif iVjr_init_createDefaultObjects(); // Create our main screen window #if !defined(_NONVJR_COMPILE) iVjr_appendSystemLog(thisCode, (u8*)"TEMPORARY: Manually create _jdebi"); iVjr_init_jdebi_create(); // Initially render each one iVjr_appendSystemLog(thisCode, (u8*)"Render _jdebi"); iObj_render(NULL, _jdebi, true); // Attach them to physical windows iVjr_appendSystemLog(thisCode, (u8*)"Allocate OS Window for _jdebi"); gWinJDebi = iWindow_allocate(); iObj_createWindowForForm(NULL, _jdebi, gWinJDebi, IDI_JDEBI); // Initially populate _screen // Load in the history if it exists if (!iSEM_loadFromDisk(thisCode, NULL, screenData, cgcScreenDataFilename, false, true)) { // Indicate success sprintf((s8*)logBuffer, "Loaded: %s\0", cgcScreenDataFilename); iSEM_appendLine(thisCode, _output_editbox->p.sem, logBuffer, (s32)strlen(logBuffer), false); iVjr_appendSystemLog(thisCode, (u8*)"Populate _screen with default data"); iSEM_appendLine(thisCode, screenData, (u8*)cgcScreenTitle, -1, false); iSEM_appendLine(thisCode, screenData, NULL, 0, false); iSEM_appendLine(thisCode, screenData, (u8*)"Please report any bugs: http://www.visual-freepro.org/vjr", -1, false); iSEM_appendLine(thisCode, screenData, (u8*)"Thank you, and may the Lord Jesus Christ bless you richly. :-)", -1, false); iSEM_appendLine(thisCode, screenData, NULL, 0, false); iSEM_appendLine(thisCode, screenData, (u8*)" _____ In God's sight we've come together.", -1, false); iSEM_appendLine(thisCode, screenData, (u8*)" | | We've come together to help each other.", -1, false); iSEM_appendLine(thisCode, screenData, (u8*)" | | Let's grow this project up ... together!", -1, false); iSEM_appendLine(thisCode, screenData, (u8*)" ________| |________ In service and love to The Lord, forever!", -1, false); iSEM_appendLine(thisCode, screenData, (u8*)" | |", -1, false); iSEM_appendLine(thisCode, screenData, (u8*)" |________ ________| Sponsored by:", -1, false); iSEM_appendLine(thisCode, screenData, (u8*)" | | LibSF -- Liberty Software Foundation", -1, false); iSEM_appendLine(thisCode, screenData, (u8*)" | |", -1, false); iSEM_appendLine(thisCode, screenData, (u8*)" | | Contributors:", -1, false); iSEM_appendLine(thisCode, screenData, (u8*)" | | Hernan Cano, Stefano D'Amico", -1, false); iSEM_appendLine(thisCode, screenData, (u8*)" | |", -1, false); iSEM_appendLine(thisCode, screenData, (u8*)" | | Lead Project Contact: [email protected]", -1, false); iSEM_appendLine(thisCode, screenData, (u8*)" | |", -1, false); iSEM_appendLine(thisCode, screenData, (u8*)" | | We need more coders. Please consider helping out.", -1, false); iSEM_appendLine(thisCode, screenData, (u8*)" |_____| Your contribution would make a difference. :-)", -1, false); iSEM_appendLine(thisCode, screenData, NULL, 0, false); } // Navigate to the end of the content iSEM_navigateToEndLine(thisCode, screenData, _screen); // Initially populate _jdebi // Load in the history if it exists if (!iSEM_loadFromDisk(thisCode, NULL, _command_editbox->p.sem, cgcCommandHistoryFilename, true, true)) { // Indicate success sprintf((s8*)logBuffer, "Loaded: %s\0", cgcCommandHistoryFilename); iSEM_appendLine(thisCode, _output_editbox->p.sem, logBuffer, (s32)strlen(logBuffer), false); iSEM_appendLine(thisCode, _command_editbox->p.sem, (u8*)"*** Welcome to Visual FreePro, Junior! :-)", -1, false); iSEM_appendLine(thisCode, _command_editbox->p.sem, (u8*)"*** For now, this can be thought of as a command window ... with a twist.", -1, false); iSEM_appendLine(thisCode, _command_editbox->p.sem, (u8*)"*** It works like an editor window. You can insert new lines, edit old ones, etc.", -1, false); iSEM_appendLine(thisCode, _command_editbox->p.sem, (u8*)"*** To execute a command, press F6. If you're on the last line use F6 or Enter.", -1, false); iSEM_appendLine(thisCode, _command_editbox->p.sem, (u8*)"*** See http://www.visual-freepro.org/wiki/index.php/VXB for supported commands.", -1, false); iSEM_appendLine(thisCode, _command_editbox->p.sem, (u8*)"*** Remember always: Love makes you smile. It keeps an inner peace like no other. :-)", -1, false); } // Navigate to the last line iSEM_navigateToEndLine(thisCode, _command_editbox->p.sem, _command_editbox); // Make sure there's a blank line at the end if (_command_editbox->p.sem->line_cursor->sourceCode_populatedLength != 0) { iSEM_appendLine(thisCode, _command_editbox->p.sem, NULL, 0, false); iSEM_navigateToEndLine(thisCode, _command_editbox->p.sem, _command_editbox); } // Load some source code if (iSEM_loadFromDisk(thisCode, _sourceCode_rider, _sourceCode_editbox->p.sem, cgcStartupPrgFilename, true, true)) { // Indicate success sprintf((s8*)logBuffer, "Loaded: %s\0", cgcStartupPrgFilename); iSEM_appendLine(thisCode, _output_editbox->p.sem, logBuffer, (s32)strlen(logBuffer), false); } // Redraw iVjr_appendSystemLog(thisCode, (u8*)"Final render _jdebi"); iWindow_render(NULL, gWinJDebi, true); // Remove the splash screen 1/2 second later CreateThread(0, 0, &iSplash_delete, (LPVOID)500, 0, 0); #if defined(_GRACE_COMPILE) // Create a thread to display the content in 3D memset(¶ms, 0, sizeof(params)); params._func_mouse = (uptr)&iGrace_mouse; params._func_motion = (uptr)&iGrace_motion; params._func_passiveMotion = (uptr)&iGrace_passiveMotion; params._func_key = (uptr)&iGrace_key; params._func_special = (uptr)&iGrace_special; params._func_reshape = (uptr)&iGrace_reshape; params._func_display = (uptr)&iGrace_display; params._func_idle = (uptr)&iGrace_idle; CreateThread(0, 0, &iGrace, (LPVOID)¶ms, 0, 0); #endif #endif }