예제 #1
0
int HTMLInputPassword::SetProperty(HTMLAttributeType Property, WEBC_CHAR *value, HTMLDocument *pDocument, int call_base)
{
	if (pDocument == 0)
	{
		pDocument = GetDocument();
	}

	switch (Property)
	{
		case HTML_ATTRIB_SIZE:
			SetSize(webc_atoi(value));
			return (1);

		case HTML_ATTRIB_MAXLENGTH:
			SetMaxLength(webc_atoi(value));
			return (1);

		default:
			break;
	}

	if (call_base)
	{
		return (HTMLInput::SetProperty(Property, value, pDocument, call_base));
	}

	return (0);
}
예제 #2
0
// Create the control
// pLTClient	   - Pointer to the client interface.
// nCommandID	   - The command ID which is sent when "enter" is pressed.
// pFont		   - The font to use for rendering the strings.
// nMaxLength	   - The size of the buffer to store the string in.
// pMessageCtrl    - control which receives messages when the "enter" key is pressed.
// pStringValue	   - pointer to the string to be modified in UpdateData.
LTBOOL CLTGUIEditCtrl::Create (  ILTClient *pLTClient, uint32 nCommandID, CUIFont *pFont, uint8 nFontSize, 
								uint16 nMaxLength, CLTGUICommandHandler *pCommandHandler, char *pStringValue, 
								uint32 nParam1, uint32 nParam2 )
{
	if (!pLTClient || !pFont || nMaxLength < 0)
        return LTFALSE;

	m_pLTClient			= pLTClient;
	m_pCommandHandler	= pCommandHandler;
	m_pStringValue		= pStringValue;

	SetMaxLength(nMaxLength);

	if (!SetFont(pFont,nFontSize))
	{
        return LTFALSE;
	}


	// Add the string
	if (pStringValue)
	{
		SetText(pStringValue);
	}

	g_pDrawPrim->SetRGBA(&m_Caret,0xFFFFFFFF);
	g_pDrawPrim->SetRGBA(&m_Frame[0],0x7F000000);
	g_pDrawPrim->SetRGBA(&m_Frame[1],0x7FFFFFFF);
	g_pDrawPrim->SetRGBA(&m_Frame[2],0x7FFFFFFF);
	g_pDrawPrim->SetRGBA(&m_Frame[3],0x7F000000);


	CLTGUICtrl::Create(nCommandID,nParam1,nParam2);
    return LTTRUE;
}
예제 #3
0
// Create the control
bool CLTGUIEditCtrl::Create(ILTClient *pLTClient, const CFontInfo& Font, const CLTGUIEditCtrl_create& cs)
{
	LTASSERT((cs.nMaxLength > 0 && cs.nMaxLength <= kMaxLength),"CLTGUIEditCtrl::Create() invalid buffer length");
	if (!pLTClient || !Font.m_nHeight || cs.nMaxLength <= 0)
        return false;



	m_pLTClient			= pLTClient;
	g_pLTBase			= pLTClient;
	m_pCommandHandler	= cs.pCommandHandler;
	m_pszValue			= cs.pszValue;
	m_bPreventEmptyString = cs.bPreventEmptyString;

	if (cs.nMaxLength <= kMaxLength)
		SetMaxLength(cs.nMaxLength);
	else
		SetMaxLength(kMaxLength);

	if (!SetFont(Font))
	{
        return false;
	}


	// Add the string
	if (cs.pszValue)
	{
		SetText(cs.pszValue);
	}

	DrawPrimSetRGBA(m_Caret,    0xFF, 0xFF, 0xFF, 0xFF);
	DrawPrimSetRGBA(m_Frame[0], 0x00, 0x00, 0x00, 0x7F);
	DrawPrimSetRGBA(m_Frame[1], 0xFF, 0xFF, 0xFF, 0x7F);
	DrawPrimSetRGBA(m_Frame[2], 0xFF, 0xFF, 0xFF, 0x7F);
	DrawPrimSetRGBA(m_Frame[3], 0x00, 0x00, 0x00, 0x7F);

	m_bUseFrame = cs.bUseFrame;

	EnableCaret(cs.bUseCaret, cs.fCaretTime, cs.argbCaretColor);
	SetInputMode(cs.eMode);

	m_Text.SetGlowParams(cs.bGlowEnable,cs.fGlowAlpha,cs.vGlowSize);

	CLTGUICtrl::Create(cs);
    return true;
}
예제 #4
0
JXSaveFileInput::JXSaveFileInput
	(
	JXContainer*		enclosure,
	const HSizingOption	hSizing,
	const VSizingOption	vSizing,
	const JCoordinate	x,
	const JCoordinate	y,
	const JCoordinate	w,
	const JCoordinate	h
	)
	:
	JXInputField(enclosure, hSizing, vSizing, x,y, w,h)
{
	SetCharacterInWordFunction(SIsCharacterInWord);

#ifdef _J_UNIX
	SetMaxLength(255);
#endif
}
예제 #5
0
파일: GF2X.cpp 프로젝트: tell/ntl-unix
GF2X::GF2X(INIT_SIZE_TYPE, long n)
{
   SetMaxLength(n);
}