Jump to content

g0gcd

Active Members
  • Posts

    23
  • Joined

  • Last visited

Community Answers

  1. g0gcd's post in How to access OO/LBO Calc Picture objects? was marked as the answer   
    So, this so often happens that I'm now considering writing my questions to a dummy forum. Once I'd laid the question out, I found a work around.
    Instead of deleting the rows where the images are, I use this first:
    _OOoCalc_RangeClearContents($oCalc, "C" & $x+1 & ":AZ" & $xEnd, -1, -1, -1, -1, 128) ;128 for objects, 1023 for all types of data) This clears the offending pictures and now when I collapse the sheet by deleting the redundant rows, they don't pile up at the bottom of the sheet.
    Someone else might try the same approach - I hope that I save them some time by sharing.
     
    I'd still love to find out how I can access an array of picture objects and query them to establish their anchors and thereby identify them. That would be far safer and more reliable than my clumsy approach.
    But, for now, back to programming and testing.
    Regards
    John
     

  2. g0gcd's post in OOoCalc.au3 Copy Sheet to same workbook? was marked as the answer   
    @donnyh13 thanks for the prompt reply.
    I emulated this approach using the native LibreOffice controls (copying the cells and pasting) and it didn't bring the links between the charts and the cells over properly.
    What I did (and should have done before asking) was to read the link information in the UDF. By changing very few lines of code, I have modified _OOoCalc_SheetMove() and created _OOoCalc_SheetCopy() to do exactly what I need to do. The key is $oObj.Sheets.moveByName(). Calling $oObj.Sheets.copyByName() instead, with the additional parameter, does the trick.
    I do need to tidy up the error checking on the new parameter but I can now move on! 
    Thanks for your help
    John
     
    ; #FUNCTION# ==================================================================================================================== ; Name ..........: _OOoCalc_SheetCopy ; Description ...: Copy the specified sheet to another specified position. ; Syntax ........: _OOoCalc_SheetMove(ByRef $oObj, $sSheet, $sNewSheet, $iPosition) ; _OOoCalc_SheetCopy(ByRef $oObj, $iPosition, $sNewSheet, $vSheet = -1) ; Parameters ....: $oObj - Calc object opened by a preceding call to _OOoCalc_BookOpen, _OOoCalc_BookNew, or ; _OOoCalc_BookAttach ; $sSheet - Name of the sheet to move ; $sNewSheet - New sheet name ; $iPosition - Position in which to move sheet. ; $vSheet - [optional] Worksheet, either by index (0-based) or name. ; Default is -1, which would use the active worksheet. ; Return values .: On Success - Returns 1 ; On Failure - Returns 0 and sets @error: ; |@error - 0 ($_OOoCalcStatus_Success) = No Error ; | - 3 ($_OOoCalcStatus_InvalidDataType) = Invalid Data Type ; | - 5 ($_OOoCalcStatus_NoMatch) = No Match ; |@extended - Contains Invalid Parameter Number ; Author ........: GMK ; Modified ......: g0gcd 27/12/2024 ; Remarks .......: Modification of _OOoCalc_SheetMove(). No error checking on $NewSheet ; Related .......: _OOoCalc_SheetAddNew, _OOoCalc_SheetDelete, _OOoCalc_SheetNameGet, _OOoCalc_SheetNameSet, _OOoCalc_SheetList, _OOoCalc_SheetActivate, _OOoCalc_SheetMove ; Link ..........: http://www.openoffice.org/api/docs/common/ref/com/sun/star/sheet/XSpreadsheets.html#moveByName ; http://www.openoffice.org/api/docs/common/ref/com/sun/star/sheet/XSpreadsheets.html#copyByName ; Example .......: No ; =============================================================================================================================== Func _OOoCalc_SheetCopy(ByRef $oObj, $iPosition, $sNewSheet, $vSheet = -1) Local $oOOoCalc_COM_ErrorHandler = ObjEvent("AutoIt.Error", __OOoCalc_ComErrorHandler_InternalFunction) #forceref $oOOoCalc_COM_ErrorHandler If Not IsObj($oObj) Then Return SetError($_OOoCalcStatus_InvalidDataType, 1, 0) If Not IsInt($iPosition) Then Return SetError($_OOoCalcStatus_InvalidDataType, 2, 0) If Not IsInt($vSheet) And Not IsString($vSheet) Then Return SetError($_OOoCalcStatus_InvalidDataType, 3, 0) If $vSheet > -1 And Not __OOoCalc_WorksheetIsValid($oObj, $vSheet) Then Return SetError($_OOoCalcStatus_NoMatch, 3, 0) If IsInt($vSheet) Then $vSheet = ($vSheet < 0) ? (_OOoCalc_SheetNameGet($oObj)) : ($oObj.getSheets.getByIndex($vSheet).name) $oObj.Sheets.copyByName($vSheet, $sNewSheet, $iPosition) Return SetError($_OOoCalcStatus_Success, 0, 1) EndFunc ;==>_OOoCalc_SheetCopy  
  3. g0gcd's post in Does GUICtrlSetState() force a key click? was marked as the answer   
    In fact, unless I'm missing something obvious (which is perfectly possible), isn't it the case that Zedna and I have been misled by bit manipulation?
    As the (now working) code firstly ensures that the upper 16 bits are zero, and then extracts the lower 16 bits to match with the control handle, I think that we only need to:
    Func _WM_COMMAND($hWnd, $Msg, $wParam, $lParam) Switch $wParam Case $hKill ;etc... Endswitch EndFunc . and therefore, it was the insertion of the BitAND that's caused the trouble....
    From https://learn.microsoft.com/en-us/windows/win32/menurc/wm-command#parameters, I now understand that the upper 16bits of $wParam (for $Msg 0x111 = WM_COMMAND) indicate accelerator actions related to the control. These are possibly what caused my observation of spurious key presses. I've not yet been able to confidently associate an accelerator to a DISABLE/ENABLE or SHOW/HIDE command but I'll keep plugging on.
    But for now, it's onwards with tidying up that code and finishing the project, so that I can get on with the real job of testing radio sets.
    Thanks again for your help.
    Regards
    John
     
×
×
  • Create New...