Article View: adobe.indesign.sdk
Article #44Re: CS3 / Win: Lock an anchored text frame
From: toan.nguyen
Date: Thu, 08 Nov 2012 03:22
Date: Thu, 08 Nov 2012 03:22
42 lines
2651 bytes
2651 bytes
On Monday, March 23, 2009 10:31:29 PM UTC+7, hstoess...@pm-medici.ch wrote:
> Hi
>
> I lock frames using the following code (snippet):
>
> ...
> InterfacePtr<ICommand> ipSetStoryLockStateCmd(CmdUtils::CreateCommand(kSetItemLockDataCmdBoss));
> InterfacePtr<IBoolData> ipLockData(ipSetStoryLockStateCmd, IID_IBOOLDATA);
> // ipTextModel - >this is an interface <ITextModel>
> InterfacePtr<IItemLockData> ipTextLockData(ipTextModel, UseDefaultIID());
> if(ipTextLockData == nil)
> {
> break;
> }
>
> // set the command data
> if (ipTextLockData->GetInsertLock()) {
> ipLockData->Set(kFalse); // unlock
> } else {
> ipLockData->Set(kTrue); // lock
> }
> ipSetStoryLockStateCmd->SetItemList(UIDList(ipTextModel));
> if (CmdUtils::ProcessCommand(ipSetStoryLockStateCmd) != kSuccess)
> {
> ASSERT_FAIL("SetStoryLockStateCmd failed");
> break;
> }
> ...
>
> This works if the TextModel is in a text frame is not anchored. If the text frame is anchored the TextModel is never locked and the user can input some text.
>
> - Is is possible to look anchored text frames?
> - What is wrong?
> - How can I lock the input in a text frame or text model?
>
> Thanks for an answer.
>
> Hans
if you want to lock which user can not to edit you can use following code:
ipTextLockData->SetInsertLock(kTrue); // lock
ipTextLockData->SetAttributeLock(kTrue); // lock
Technical Details
Message-ID:
<ec864b8d-eb75-4939-b540-241189a2602c@googlegroups.com>Path:
arc1-ca.pugleaf.net!s9ni82046pbb.0!nntp.google.com!kt20no35749984pbb.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mailReferences:
<59b8622a.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f63e9,edbe86f910e7290f
X-Google-NewGroupId: yes
X-Google-Attributes: gid79d0882076,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Received: by 10.66.87.73 with SMTP id v9mr2514673paz.46.1352344980146;
Wed, 07 Nov 2012 19:23:00 -0800 (PST)
Received: by 10.68.212.72 with SMTP id ni8mr712316pbc.14.1352344980114; Wed,
07 Nov 2012 19:23:00 -0800 (PST)
Path: arc1-ca.pugleaf.net!s9ni82046pbb.0!nntp.google.com!kt20no35749984pbb.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: adobe.indesign.sdk
Date: Wed, 7 Nov 2012 19:22:59 -0800 (PST)
In-Reply-To: <59b8622a.-1@webcrossing.la2eafNXanI>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=115.78.162.164;
posting-account=pLTGyAoAAABRLPE1Bg6hkGj-FvJacamN
NNTP-Posting-Host: 115.78.162.164
References: <59b8622a.-1@webcrossing.la2eafNXanI>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ec864b8d-eb75-4939-b540-241189a2602c@googlegroups.com>
Subject: Re: CS3 / Win: Lock an anchored text frame
From: toan.nguyen@audiencemedia.com
Injection-Date: Thu, 08 Nov 2012 03:23:00 +0000
Content-Type: text/plain; charset=ISO-8859-1