Skip to main content
Known Participant
June 1, 2009
Question

TextBox losing its text when focus changed?

  • June 1, 2009
  • 1 reply
  • 1506 views

Hi all,

Im developing a plugin in Illustrator CS3 using VisualStudio 2005.

I design my dialog using ADM in VS.

The textbox losing its text when focus is changed.

In my dialog i have a textbox,checkbox and a ok and cancel button.

In case, if i enter the text and press tab or the checkbox (before moving the focus to ok or cancel button) the text remains uncleared.

But if i enter the text and move the mouse to ok or cancel button the text box value gets cleared.

Please someone guide me to solve this problem.

Thanks in advance,

Poovili

This topic has been closed for replies.

1 reply

A. Patterson
Inspiring
June 1, 2009

Is this the same dialog you were having trouble with a week or so ago when you posted? If so, I asked a question about how it was working in tha thread that might be related to your problem. If not, post some code and maybe we can figure out what's going on in your dialog. By & large the ADM -- for all of its flaws -- is fairly straight forward. Chances are, if its erasing your text, you're doing it somehow (probably inadvertently).

Oviya___Author
Known Participant
June 2, 2009

Hi,

Ya i still have that same problem.

ASErr ASAPI QCCheckDialogProc(ADMDialogRef dialog)
{
    PUSH_GLOBALS
    ASErr                    fxErr = kNoErr;

    sADMDialog->SetDrawProc(dialog,DialogDrawProc);

     sADMItem->SetNotifyProc( sADMDialog->GetItem(dialog, txtSample), TextBoxProc );

}

static void ASAPI TextBoxProc( ADMItemRef item, ADMNotifierRef notifier)
{
    PUSH_GLOBALS
     if ( sADMNotifier->IsNotifierType( notifier, kADMUserChangedNotifier ) )
    {
        dlg = sADMItem->GetDialog(item);

        if (item == sADMDialog->GetItem(dlg, txtSample))        
        {   
            sADMItem->GetText(item,g->Sample ,256);
        }

     }

}

static void ASAPI DialogDrawProc( ADMDialogRef dialog,ADMDrawerRef drawer)
{
    ADMItemRef ItemRef;

    ItemRef=sADMDialog->GetItem(g->CheckDialog ,txtSample);
    sADMItem->SetText(ItemRef,g->Sample );

}

This is the code im using for getting the text box value.

I dont know where the problem is.

A. Patterson
Inspiring
June 2, 2009

This is the code im using for getting the text box value.

I dont know where the problem is.

First thing I would do is turn not set a DrawProc. You only need that if you're doing some customized control drawing, which it doesn't look like you are. In fact, it looks like you're changing the contents of your input everytime it draws, which sounds like it could cause the kind of trouble you're having.So take out the SetDrawProc() line and see if it gets better.