Subject: | Re: How to disable minimizing of report view by user
| Date: | Tue, 24 Nov 2020 18:23:02 -0800
| From: | Peter <peterspammenot@whiteknight.email>
| Newsgroups: | pnews.paradox-programming
|
This is exactly what I want to do but the link is (unsurprisingly)
broken. Does anyone have this download that can share it? Thank you.
Peter
On 5/11/2005 11:43 AM, janM wrote:
> Martin,
>
>> Is is possible to disable minimize/maximize/close button in upper right
>
>> corner ???
>
> Yes, it is done and you can download below an example.
> Unzip, put it in the work dir and run the form: testrepmp.fsl
> And push the button in the middle of the form for running testrep.rsl
>
> The zip file contains:
> libfrmmc.lsl
> libfrmws.lsl
> testrep.rsl
> testrepmp.fsl
>
>
> http://users.skynet.be/fa495766/repmp.zip
>
>
> The code at form level: init, uses, var and of course the pushbutton:
> method pushButton(var eventInfo Event)
> var
> ; tbar Toolbar
>
> muOrderRpt Menu
> puRptFile, purptPage PopUpMenu
> rHandle Report ;// tmp handle to report
> ; printerInfo PrinterOptionInfo
> rptname string
>
> ;controlbox manipulation
> loRet logical
> liRet longint
>
> ;workspace manipulation
> liWorkX longint
> liWorkY longint
>
> liWorkH longint
> liWorkW longint
>
> liX, liY, liW, liH longint
>
> app application
>
> endvar
> delayScreenUpdates(yes)
> ; I left this out but you can use it of course
> ; printerGetOptions(printerinfo)
>
> ; printerInfo.Orientation = PrintDefaultOrientation
>
> ; printerInfo.PaperSize = prnLetter
> ; printerSetOptions(printerinfo)
>
> rptname = ":work:testrep"
>
> ;the report should open hidden not maximized because we are going to 'inject'
> it
> if not rHandle.open(rptname, WinStyleHidden) then
> ;err_handle("...." +rptname)
> ;return False
> msginfo("Report", "Not opened")
> return
> endif
> rHandle.StandardMenu = False
>
>
> ;first manipulation of the controlmenu(on the left)
> ; and min - max - close buttons (on the right)
> lbLibfrmmc.cmDeleteMenus(rHandle.windowHandle(),1,1,1,1,1,1,1,1,1)
> lbLibfrmmc.cmDisableMaxButton(rHandle.windowHandle())
> lbLibfrmmc.cmDisableMinButton(rHandle.windowHandle())
>
>
> ;we just want to fill in the workspace of the application so no maximize,
> ;otherwise it won't work !!
> loRet = lbLibfrmws.cmGetApplicationWorkspace(app.windowClientHandle(),liWorkX,liWorkY,liWorkW,liWorkH)
> if loRet = True then
> rHandle.getposition(liX, liY, liW, liH)
> rHandle.setposition(liWorkX, liWorkY, liWorkW, liWorkH)
>
> endif
>
> ;finish it with subclassing
> lbLibfrmmc.cmAdaptReport(rHandle.windowHandle(),0,0,0,0)
>
>
> ;***** YOURS I PRESUME
> puRptFile.addText("Print report", MenuEnabled, MenuFilePrint)
> puRptFile.addText("Close report", MenuEnabled, MenuControlClose)
>
> ;*****
> puRptPage.addText("First ...", MenuEnabled, MenuReportPageFirst)
> puRptPage.addText("Last", MenuEnabled, MenuReportPageLast)
> puRptPage.addText("Next... Shift+F4", MenuEnabled, MenuReportPageNext)
> puRptPage.addText("Previous... Shift+F3", MenuEnabled,
> MenuReportPagePrevious)
>
> muOrderRpt.addPopUp("Print", puRptFile)
> muOrderRpt.addPopUp("Page", puRptPage)
>
> rHandle.setMenu(muOrderRpt)
>
> ;for testing I have disabled this
> ;if tbar.attach("Property") then
> ; if tbar.isVisible() then
> ; tbar.hide()
> ; endif
> ;endif
>
> ;rHandle.wait()
>
> ;try
> ; rHandle.close()
> ;onFail
> ; do nothing; report is already closed
> ;endTry
>
> ;--------------------
> ;bring to form to top = visible with all the new features
> rHandle.bringToTop()
>
>
> delayScreenUpdates(no)
>
> endMethod
>
>
> Jan
>
|