Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Urs Eggmann" Newsgroups: comp.lang.clipper.visual-objects Subject: Re: Deleting menuitem Separator Date: Sat, 12 Dec 2015 22:45:34 +0100 Lines: 99 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit X-Trace: individual.net qEYqN30aCfyxxiKfjYGLqAJ2JDa7WBEx06rkEuXX3e9+27zxBh Cancel-Lock: sha1:YoAt/RkeF4dAbngDeEUOZ74RVgg= X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: csiph.com comp.lang.clipper.visual-objects:8804 Hi Jozo and Phil, Thanks for completing the code. Urs "Jozo" schrieb im Newsbeitrag news:n4fho1$qkm$1@ls237.t-com.hr... > Hi Urs, > > Here is method from Jean-Luc but I have excepted this piece of code > because I don't need it. > > METHOD CleanMenu( ptrMenu ) CLASS Izb > LOCAL wCount AS DWORD, nItemID AS DWORD > LOCAL ptrPopUp AS PTR > LOCAL lSeparator AS LOGIC > LOCAL iIdx AS INT, iCount AS INT > > IF IsNil( ptrMenu ) > ptrMenu := SELF:Handle() > ENDIF > lSeparator := FALSE > wCount := ( GetMenuItemCount( ptrMenu ) - 1 ) // Zero Based > iCount := ( GetMenuItemCount( ptrMenu ) - 1 ) // Zero Based > FOR iIdx := iCount DOWNTO 0 > nItemID := GetMenuItemID( ptrMenu, iIdx ) > DO CASE > // a Sub-Menu > CASE nItemID = 0xFFFFFFFF > ptrPopUp := GetSubMenu( ptrMenu, iIdx ) > IF GetMenuItemCount( ptrPopUp ) < 1 > DeleteMenu( ptrMenu, iIdx, MF_BYPOSITION ) > ELSE > SELF:CleanMenu( ptrPopUp ) > IF GetMenuItemCount( ptrPopUp ) < 1 > DeleteMenu( ptrMenu, iIdx, MF_BYPOSITION ) > ENDIF > ENDIF > // a Separator > CASE nItemID = 0 > IF lSeparator .or. ; > ( iIdx = (GetMenuItemCount( ptrMenu ) - 1 ) ) .or. ; // separator at > the END > ( iIdx = 0 ) // separator at the beginning > DeleteMenu( ptrMenu, iIdx, MF_BYPOSITION ) > ELSE > lSeparator := TRUE > ENDIF > OTHERWISE > lSeparator := FALSE > ENDCASE > NEXT > IF ptrMenu == SELF:Handle() > // SELF:CleanToolBar() > // wCount := ( GetMenuItemCount( ptrMenu ) - 1 ) // Zero Based > // SELF:SetAutoUpdate(wCount - 1) > ENDIF > RETURN NIL > > > > "Urs Eggmann" wrote in message > news:dd0s0aFa241U1@mid.individual.net... >> Hi Jozo, >> >> By Google search I found a post from Roger Lawton (Sept 2005) with the >> method CleanMenu(PtrMenu) that calls a method CleanToolBar() . >> That method I could not find. >> >> What about sharing the complete solution with us ? >> >> Thanks >> Urs >> >> "Jozo" schrieb im Newsbeitrag >> news:n4cua5$jld$1@ls237.t-com.hr... >>>I found two solutions, Jean-Luc Stassen and Phil McGuinness. >>> Thank them >>> >>> >>> >>> "Jozo" wrote in message >>> news:n4cpa1$hgd$1@ls237.t-com.hr... >>>> Hi all, >>>> >>>> does anyone know how deleting specific SEPARATOR in Menu ? >>>> >>>> Thanks for any help. >>>> >>>> >>>> >>> >>> >> > >