JXPathInput::JXPathInput
	(
	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),
	itsCompleter(NULL),
	itsCompletionMenu(NULL)
{
	itsAllowInvalidPathFlag = kJFalse;
	itsRequireWriteFlag     = kJFalse;
	itsExpectURLDropFlag    = kJFalse;
	SetIsRequired();
	SetCharacterInWordFunction(IsCharacterInWord);
	SetDefaultFont(JGetMonospaceFontName(), kJDefaultMonoFontSize, JFontStyle());
	ShouldBroadcastCaretLocationChanged(kJTrue);
	SetHint(JGetString(kHintID));
	ListenTo(this);
}
示例#2
0
//---------------------------------------------------------------------------
void tTVPLayerManager::PrimaryMouseDown(tjs_int x, tjs_int y, tTVPMouseButton mb,
	tjs_uint32 flags)
{
	PrimaryMouseMove(x, y, flags);
	tTJSNI_BaseLayer * l = CaptureOwner ? CaptureOwner : GetMostFrontChildAt(x, y);
	if(l)
	{
		l->FromPrimaryCoordinates(x, y);
		ReleaseCaptureCalled = false;
		l->FireMouseDown(x, y, mb, flags);
		bool no_capture = ReleaseCaptureCalled;

		if(CaptureOwner != l)
		{
			ReleaseCapture();

			if(!no_capture)
			{
				CaptureOwner = l;
				if(CaptureOwner->Owner) CaptureOwner->Owner->AddRef(); // addref TJS object
			}
		}
		
		SetHint(NULL,ttstr());
	}
	else
	{
		ReleaseCapture();
	}

}
示例#3
0
//---------------------------------------------------------------------------
void tTVPLayerManager::NotifyHintChange(tTJSNI_BaseLayer *layer, const ttstr & hint)
{
	if(InNotifyingHintOrCursorChange) return;

	InNotifyingHintOrCursorChange = true;

	try
	{
		tTJSNI_BaseLayer *l;

		if(CaptureOwner)
			l = CaptureOwner;
		else
			l = GetMostFrontChildAt(LastMouseMoveX, LastMouseMoveY);

		if(l == layer) SetHint(l->GetOwnerNoAddRef(),hint);
	}
	catch(...)
	{
		InNotifyingHintOrCursorChange = false;
		throw;
	}

	InNotifyingHintOrCursorChange = false;
}
Resource* CreateSlider( XMLIterator i, XMLCreatorEnv *env )
{
    XMLCreatorEnv ch_env;
    XMLAttributes attributes;
    XMLStyle      branch_style;
    CascadeStyles( i, env, attributes, branch_style, ch_env);

    int size = to_integer( get_attribute( attributes, "size" ) );
    std::string skins = get_attribute( attributes, "skin" );
    
    SliderWidget* ptr = new SliderWidget( size, QuerySkinSet( skins ) );
 
    int value = 2;    
    if( try_attribute_i( attributes, "states", &value) && value < 2 )
    {
        throw Error("Slider %s must have almost 2 states.", (*i)._name.c_str());
    }
    
    ptr->SetNumStates( value );
    
    if( try_attribute_i( attributes, "select", &value ) )
    {
        ptr->SetSelected( value );
    }
    
    if( try_attribute_i( attributes, "grip_size", &value ) )
    {
        ptr->SetGripSize( value ); 
    }

    InsertChildWidget( ptr, attributes, env);
    SetHint(ptr, attributes);
    
    return new AnyResource<SliderWidget*>( ptr );
}
GMMessageDragSource::GMMessageDragSource
	(
	GMessageViewDir*	dir,
	JXContainer*		enclosure,
	const HSizingOption	hSizing,
	const VSizingOption	vSizing,
	const JCoordinate	x,
	const JCoordinate	y,
	const JCoordinate	w,
	const JCoordinate	h
	)
	:
	JXImageWidget(enclosure, hSizing, vSizing, x,y, w,h)
{
	itsDir	= dir;

	JXImage* icon = new JXImage(GetDisplay(), envelope_front);
	assert( icon != NULL );
	icon->ConvertToRemoteStorage();
	SetImage(icon, kJTrue);

	SetHint(kHintText);

	SetBorderWidth(0);

	// targets for DND

	itsMessageXAtom	= GetDisplay()->RegisterXAtom(kDragMessagesXAtomName);
}
示例#6
0
void CMapLocation::load(IReader &stream)
{
	u16 c =			stream.r_u16();
	xr_string		hint;
	stream.r_stringZ(hint);
	SetHint			(hint.c_str());
	SetRefCount		(c);
	m_flags.flags	= stream.r_u32	();
}
示例#7
0
void CMapLocation::load(IReader &stream)
{
	xr_string		str;
	stream.r_stringZ(str);
	SetHint			(str.c_str());
	m_flags.flags	= stream.r_u32	();

	stream.r_stringZ(str);
	m_owner_task_id	= str.c_str();
}
Resource* CreateScrolledWidget( XMLIterator i, XMLCreatorEnv *env )
{
    XMLCreatorEnv ch_env;
    const char *p_name = "create popup";
    BeginParentWidget( env, p_name, ch_env );

    XMLAttributes attributes;
    XMLStyle      branch_style;
    CascadeStyles( i, env, attributes, branch_style, ch_env );

    int speed = ScrolledWidget::DEFFAULT_SPEED;
    try_attribute_i( attributes, "speed", &speed );

    int dragSliding = false;
    try_attribute_i( attributes, "drag_slide", &dragSliding );

    std::vector<int> adv = to_integer_vector( "0,0" );
    std::string advance;
  
    if ( try_attribute( attributes, "advance", &advance ) )
    {
        adv = to_integer_vector( advance );
        if ( adv.size() != 2 ) { throw Error("Advance attribute must have x and y coordinates"); }
    }

    //temporary hub
    SPointer<HubWidget> ptr = new HubWidget( 100, 100 );
    ch_env["parent_hub"] = ptr.get();

    // create children elements
    ChildsFromXML( i, &ch_env );

    if( ptr->ChildrenCount( ) > 1 )
        throw Error("Scrolled widget %s has more than 1 content.", (*i)._name.c_str());     
    
    ScrolledWidget *scrollee = new ScrolledWidget();

    if( ptr->ChildrenCount( ) > 0 )
    {
        Widget* content = ptr->FirstChild();
        ptr->Retrieve( content );
        scrollee->AttachWidget( content );
    }
  
    scrollee->SetSpeed(speed);
    scrollee->SetNoDragSliding( !dragSliding );
    scrollee->HScrollTo(adv[0]);
    scrollee->VScrollTo(adv[1]);

    InsertChildWidget( scrollee, attributes, env);
    SetHint(scrollee, attributes);
    return new AnyResource<ScrolledWidget*>( scrollee );
}
示例#9
0
    wxSearchTextCtrl(wxSearchCtrl *search, const wxString& value, int style)
        : wxTextCtrl(search, wxID_ANY, value, wxDefaultPosition, wxDefaultSize,
                     (style & ~wxBORDER_MASK) | wxNO_BORDER)
    {
        m_search = search;

        SetHint(_("Search"));

        // Ensure that our best size is recomputed using our overridden
        // DoGetBestSize().
        InvalidateBestSize();
    }
示例#10
0
DBSearcher::DBSearcher(
			wxWindow *frame,
	        wxWindow* parent,
            wxWindowID id,
			const wxString& text,
            const wxPoint& pos,
            const wxSize& size,
			long style) :
		wxTextCtrl(parent, id, "", pos, size, style),
		m_frame(frame)
{
	SetHint(text);
}
示例#11
0
/**
* @author ACM2012
* @param   wparam  接管后的命令提示语\n
* @note   函数在接收到TAKEOVERCMD消息时触发,函数完成从普通命令模式到用户命令模式的切换,\n
*重新设置命令提示语并计算命令提示语的显示长度和存储长度,接管命令行输入窗口后,函数将\n
*另起一行输出命令提示语,此后的命令输入将被直接被用户命令截获而不会被命令映射机制获得
*/
LRESULT CmdView::OnTakeOverCmd(WPARAM wparam, LPARAM lparam)
{	
	///<brief 切换CmdView的状态模式
	if (CMDFLAG==ROOT)
    	CMDFLAG = USER;
	///< 设置用户命令模式下的输入状态
	LINEFLAG = OLDLINE;
	///<brief 重新设置命令提示语
	Hint = *((CString *)wparam);
	SetHint(Hint);
	myedit->ReplaceSel(Hint);
	HintLine = myedit->GetLineCount() - 1;
	return 0;
}
示例#12
0
/**
* @author ACM2012
* @note   *函数在视图附加到文档后触发,主要完成界面的初始化工作
  *函数主要实现命令出现线程的初始化,初始化完成后方建立起字符串到命令处理函数的映射
  *函数实现了字体的设置,本视图的字体设置为“Times New Roman”;函数在命令输入框内插入
  *Command提示字符,表明此时可以输入字符串命令
*/
void CmdView::OnInitialUpdate()
{
	CEditView::OnInitialUpdate();

	// TODO:  在此添加专用代码和/或调用基类
	myedit = (CEdit *)this;
	Initialcmd();
	///<brief 设置字体
	myfont.CreatePointFont(120,	(LPCTSTR)_T("Times New Roman"));
	myedit->SetFont(&myfont);
	///<brief 打印命令提示语
	SetHint(_T("Command:"));
	myedit->ReplaceSel(Hint);
	HintLine = 0;
}
示例#13
0
	myTextCtrl::myTextCtrl(
	wxWindow* frame,
	wxWindow* parent,
	wxWindowID id,
	const wxString& text,
	const wxPoint& pos,
	const wxSize& size,
	long style) :
wxTextCtrl(parent, id, "", pos, size, style),
	m_frame(frame),
	m_style(style)
{
	SetHint(text);

	m_dummy = new wxButton(parent, id, text, pos, size);
	m_dummy->Hide();
}
示例#14
0
NCursesFrontend::~NCursesFrontend()
{
#ifdef WIN32
	HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
	CONSOLE_CURSOR_INFO ConsoleCursorInfo;
	GetConsoleCursorInfo(hConsole, &ConsoleCursorInfo);
	ConsoleCursorInfo.bVisible = true;
	SetConsoleCursorInfo(hConsole, &ConsoleCursorInfo);
#else
	keypad(stdscr, false);
	echo();
	curs_set(1);
	endwin();
#endif
	printf("\n");
	SetHint(nullptr);
}
示例#15
0
/**
* @author ACM2012
* @note 命令已处理完成 该函数由命令映射函数调用,当命令处理完成后,若当前模式处于用户命令模式,
* 则退出用户命令模式,进入普通命令模式,并重新设置命令提示语为默认的“Command:”。完成后命令行
* 另起一行,获取输入焦点并输出命令提示语
*/
void CmdView::DealCmdOver()
{
	///< 切换CmdView的状态模式
	if (CMDFLAG == USER){
		myedit->ReplaceSel(_T("退出成功\r\n"));
		CMDFLAG = ROOT;
	///< 重新设置命令提示语为默认
		SetHint(_T("Command:"));
	}
	HintLine = myedit->GetLineCount() - 1;
	///<输出默认的命令提示语
	POINT cur;
	cur.x = 0;
	cur.y = HintLine*tm.tmHeight;
	SetCaretPos(cur);
	SetFocus();
	myedit->ReplaceSel(Hint);
}
void
JXPathInput::BoundsMoved
	(
	const JCoordinate dx,
	const JCoordinate dy
	)
{
	JXInputField::BoundsMoved(dx, dy);

	const JRect ap = GetAperture();
	if (ap.left != 0)
		{
		SetHint(GetText());
		}
	else
		{
		ClearHint();
		}
}
JXDocktab::JXDocktab
	(
	JXContainer*		enclosure,
	const HSizingOption	hSizing,
	const VSizingOption	vSizing,
	const JCoordinate	x,
	const JCoordinate	y,
	const JCoordinate	w,
	const JCoordinate	h
	)
	:
	JXWidget(enclosure, hSizing, vSizing, x,y, w,h),
	itsActionMenu(NULL),
	itsDockFinder(NULL)
{
	SetHint(JGetString(kHintID));

	itsFocusColor = (GetColormap())->GetColor(0, 0, kJMaxRGBValue/2);
}
示例#18
0
void NCursesFrontend::PrintKeyInputBar()
{
	int queueSize = CalcQueueSize();
	int inputBarRow = m_screenHeight - 1;

	if (!m_hint.Empty())
	{
		time_t time = Util::CurrentTime();
		if (time - m_startHint < 5)
		{
			PlotLine(m_hint, inputBarRow, 0, NCURSES_COLORPAIR_HINT);
			return;
		}
		else
		{
			SetHint(nullptr);
		}
	}

	switch (m_inputMode)
	{
	case normal:
		if (m_groupFiles)
		{
			PlotLine("(Q)uit | (E)dit | (P)ause | (R)ate | (W)indow | (G)roup | (T)ime", inputBarRow, 0, NCURSES_COLORPAIR_KEYBAR);
		}
		else
		{
			PlotLine("(Q)uit | (E)dit | (P)ause | (R)ate | (W)indow | (G)roup | (T)ime | n(Z)b", inputBarRow, 0, NCURSES_COLORPAIR_KEYBAR);
		}
		break;
	case editQueue:
	{
		const char* status = nullptr;
		if (m_selectedQueueEntry > 0 && queueSize > 1 && m_selectedQueueEntry == queueSize - 1)
		{
			status = "(Q)uit | (E)xit | (P)ause | (D)elete | (U)p/(T)op";
		}
		else if (queueSize > 1 && m_selectedQueueEntry == 0)
		{
			status = "(Q)uit | (E)xit | (P)ause | (D)elete | dow(N)/(B)ottom";
		}
		else if (queueSize > 1)
		{
			status = "(Q)uit | (E)xit | (P)ause | (D)elete | (U)p/dow(N)/(T)op/(B)ottom";
		}
		else
		{
			status = "(Q)uit | (E)xit | (P)ause | (D)elete";
		}

		PlotLine(status, inputBarRow, 0, NCURSES_COLORPAIR_KEYBAR);
		break;
	}
	case downloadRate:
		BString<100> hint("Download rate: %i", m_inputValue);
		PlotLine(hint, inputBarRow, 0, NCURSES_COLORPAIR_KEYBAR);
		// Print the cursor
		PlotText(" ", inputBarRow, 15 + m_inputNumberIndex, NCURSES_COLORPAIR_CURSOR, true);
		break;
	}
}
Resource *
CreateDropDown( XMLIterator i, XMLCreatorEnv *env )
{
    XMLCreatorEnv ch_env;
    const char *p_name = "create dropdown";
    BeginParentWidget( env, p_name, ch_env );
    
    XMLAttributes attributes;
    XMLStyle      branch_style;
    CascadeStyles( i, env, attributes, branch_style, ch_env);

    // skins & fonts for caption
    std::string skinName = get_attribute( attributes, "title_skin");
    std::string fontName = get_attribute( attributes, "title_font");
    
    SkinMan &skins = QuerySkinMan( skinName );
    FontSet &fonts = QueryFontSet( fontName );

    // caption position
    int titleAlign = 0;    
    try_attribute_i( attributes, "title_align", &titleAlign );
    
    std::vector<int> pos = to_integer_vector( "0,0" );
    std::string position;   
    if ( try_attribute( attributes, "title_distance", &position ) )
    {
        pos = to_integer_vector( position );
        if ( pos.size() != 2 ) { throw Error("pos attribute must have x and y coordinates"); }
    }
    
    CaptionStyle style( skins, fonts, titleAlign, Pos(pos[0], pos[1]) );

    
    // temporary hub for child widget
    SPointer<HubWidget> ptr = new HubWidget( 100, 100 );
    ch_env["parent_hub"] = ptr.get();

    // create child element
    ChildsFromXML( i, &ch_env );
   
    if( ptr->ChildrenCount() != 1 )
        throw Error("DropDown widget %s must have one and only content.", (*i)._name.c_str());

    Widget *content = ptr->FirstChild();
    ptr->Retrieve( content );

    if ( IWList *p_items = dynamic_cast< IWList *>( content ))
    {
        typedef DropButton< ListMenu, RadioLogic > ListMenuButton;
        
        ListMenu *lm = new ListMenuButton( style, p_items );
        p_items->Items().SetFollowMode( ListLogic::FULL_FOLLOW );
        p_items->Items().AllwaysSelected( 1 );
        
        InsertChildWidget( lm, attributes, env );
        SetHint( lm, attributes ); 
        return new AnyResource< Widget *>( lm );
    }
    else if ( IWTableList *p_table = dynamic_cast< IWTableList *>( content ))
    {
        Share< DataConnector > dataCon =
            dynamic_cast< DataTableWidget &>( p_table->Table() )
                .GetDataConnector();
        
        typedef DropButton< TableMenu, RadioLogic > TableMenuButton;
        TableMenu *tm = new TableMenuButton( style, p_table, dataCon.GetTarget() );
        
        dynamic_cast< ListLogic &>( p_table->Enumerator() )
            .SetFollowMode( ListLogic::FULL_FOLLOW );
        dynamic_cast< ListLogic &>( p_table->Enumerator() )
            .AllwaysSelected( 1 );
        
        InsertChildWidget( tm, attributes, env );
        SetHint( tm, attributes ); 
        return new AnyResource< Widget *>( tm );
    }

    return NULL;
}
示例#20
0
/*
 * Process keystrokes starting with the initialKey, which must not be
 * READKEY_EMPTY but has alread been set via ReadConsoleKey.
 */
void NCursesFrontend::UpdateInput(int initialKey)
{
	int key = initialKey;
	while (key != READKEY_EMPTY)
	{
		int queueSize = CalcQueueSize();

		// Normal or edit queue mode
		if (m_inputMode == normal || m_inputMode == editQueue)
		{
			switch (key)
			{
			case 'q':
				// Key 'q' for quit
				ExitProc();
				break;
			case 'z':
				// show/hide NZBFilename
				m_showNzbname = !m_showNzbname;
				break;
			case 'w':
				// swicth window sizes
				if (m_queueWindowPercentage == 50)
				{
					m_queueWindowPercentage = 100;
				}
				else if (m_queueWindowPercentage == 100 && m_inputMode != editQueue)
				{
					m_queueWindowPercentage = 0;
				}
				else
				{
					m_queueWindowPercentage = 50;
				}
				CalcWindowSizes();
				SetCurrentQueueEntry(m_selectedQueueEntry);
				break;
			case 'g':
				// group/ungroup files
				m_groupFiles = !m_groupFiles;
				SetCurrentQueueEntry(m_selectedQueueEntry);
				NeedUpdateData();
				break;
			}
		}

		// Normal mode
		if (m_inputMode == normal)
		{
			switch (key)
			{
			case 'p':
				// Key 'p' for pause
				if (!IsRemoteMode())
				{
					info(m_pauseDownload ? "Unpausing download" : "Pausing download");
				}
				ServerPauseUnpause(!m_pauseDownload);
				break;
			case 'e':
			case 10: // return
			case 13: // enter
				if (queueSize > 0)
				{
					m_inputMode = editQueue;
					if (m_queueWindowPercentage == 0)
					{
						m_queueWindowPercentage = 50;
					}
					return;
				}
				break;
			case 'r':
				// Download rate
				m_inputMode = downloadRate;
				m_inputNumberIndex = 0;
				m_inputValue = 0;
				return;
			case 't':
				// show/hide Timestamps
				m_showTimestamp = !m_showTimestamp;
				break;
			}
		}

		// Edit Queue mode
		if (m_inputMode == editQueue)
		{
			switch (key)
			{
			case 'e':
			case 10: // return
			case 13: // enter
				m_inputMode = normal;
				return;
			case KEY_DOWN:
				if (m_selectedQueueEntry < queueSize - 1)
				{
					SetCurrentQueueEntry(m_selectedQueueEntry + 1);
				}
				break;
			case KEY_UP:
				if (m_selectedQueueEntry > 0)
				{
					SetCurrentQueueEntry(m_selectedQueueEntry - 1);
				}
				break;
			case KEY_PPAGE:
				if (m_selectedQueueEntry > 0)
				{
					if (m_selectedQueueEntry == m_queueScrollOffset)
					{
						m_queueScrollOffset -= m_queueWinClientHeight;
						SetCurrentQueueEntry(m_selectedQueueEntry - m_queueWinClientHeight);
					}
					else
					{
						SetCurrentQueueEntry(m_queueScrollOffset);
					}
				}
				break;
			case KEY_NPAGE:
				if (m_selectedQueueEntry < queueSize - 1)
				{
					if (m_selectedQueueEntry == m_queueScrollOffset + m_queueWinClientHeight - 1)
					{
						m_queueScrollOffset += m_queueWinClientHeight;
						SetCurrentQueueEntry(m_selectedQueueEntry + m_queueWinClientHeight);
					}
					else
					{
						SetCurrentQueueEntry(m_queueScrollOffset + m_queueWinClientHeight - 1);
					}
				}
				break;
			case KEY_HOME:
				SetCurrentQueueEntry(0);
				break;
			case KEY_END:
				SetCurrentQueueEntry(queueSize > 0 ? queueSize - 1 : 0);
				break;
			case 'p':
				// Key 'p' for pause
				EditQueue(DownloadQueue::eaFilePause, 0);
				break;
			case 'd':
				SetHint(" Use Uppercase \"D\" for delete");
				break;
			case 'D':
				// Delete entry
				if (EditQueue(DownloadQueue::eaFileDelete, 0))
				{
					SetCurrentQueueEntry(m_selectedQueueEntry);
				}
				break;
			case 'u':
				if (EditQueue(DownloadQueue::eaFileMoveOffset, -1))
				{
					SetCurrentQueueEntry(m_selectedQueueEntry - 1);
				}
				break;
			case 'n':
				if (EditQueue(DownloadQueue::eaFileMoveOffset, +1))
				{
					SetCurrentQueueEntry(m_selectedQueueEntry + 1);
				}
				break;
			case 't':
				if (EditQueue(DownloadQueue::eaFileMoveTop, 0))
				{
					SetCurrentQueueEntry(0);
				}
				break;
			case 'b':
				if (EditQueue(DownloadQueue::eaFileMoveBottom, 0))
				{
					SetCurrentQueueEntry(queueSize > 0 ? queueSize - 1 : 0);
				}
				break;
			}
		}

		// Edit download rate input mode
		if (m_inputMode == downloadRate)
		{
			// Numbers
			if (m_inputNumberIndex < 5 && key >= '0' && key <= '9')
			{
				m_inputValue = (m_inputValue * 10) + (key - '0');
				m_inputNumberIndex++;
			}
			// Enter
			else if (key == 10 || key == 13)
			{
				ServerSetDownloadRate(m_inputValue * 1024);
				m_inputMode = normal;
				return;
			}
			// Escape
			else if (key == 27)
			{
				m_inputMode = normal;
				return;
			}
			// Backspace
			else if (m_inputNumberIndex > 0 && key == KEY_BACKSPACE)
			{
				int remain = m_inputValue % 10;

				m_inputValue = (m_inputValue - remain) / 10;
				m_inputNumberIndex--;
			}
		}

		key = ReadConsoleKey();
	}
}
示例#21
0
void CMapLocation::LoadSpot(LPCSTR type, bool bReload)
{
	if ( !g_uiSpotXml )
	{
		g_uiSpotXml				= xr_new<CUIXml>();
		g_uiSpotXml->Load		(CONFIG_PATH, UI_PATH, "map_spots.xml");
	}

	XML_NODE* node = NULL;
	string512 path_base, path;
	xr_strcpy		(path_base,type);
	R_ASSERT3		(g_uiSpotXml->NavigateToNode(path_base,0), "XML node not found in file map_spots.xml", path_base);
	LPCSTR s		= g_uiSpotXml->ReadAttrib(path_base, 0, "hint", "no hint");
	SetHint			(s);
	
	s = g_uiSpotXml->ReadAttrib(path_base, 0, "store", NULL);
	if ( s )
	{
		m_flags.set( eSerailizable, TRUE);
	}

	s = g_uiSpotXml->ReadAttrib(path_base, 0, "no_offline", NULL);
	if ( s )
	{
		m_flags.set( eHideInOffline, TRUE);
	}

	m_ttl = g_uiSpotXml->ReadAttribInt(path_base, 0, "ttl", 0);
	if ( m_ttl > 0 )
	{
		m_flags.set( eTTL, TRUE);
		m_actual_time = Device.dwTimeGlobal+m_ttl*1000;
	}

	s = g_uiSpotXml->ReadAttrib(path_base, 0, "pos_to_actor", NULL);
	if ( s )
	{
		m_flags.set( ePosToActor, TRUE);
	}
	
	strconcat(sizeof(path),path,path_base,":level_map");
	node = g_uiSpotXml->NavigateToNode(path,0);
	if ( node )
	{
		LPCSTR str = g_uiSpotXml->ReadAttrib(path, 0, "spot", "");
		if( xr_strlen(str) )
		{
			if ( !bReload )
			{
				m_level_spot = xr_new<CMapSpot>(this);
			}
			m_level_spot->Load(g_uiSpotXml,str);
		}else{
			VERIFY( !(bReload&&m_level_spot) );
		}

		m_spot_border_names[0] = g_uiSpotXml->ReadAttrib(path, 0, "spot_a", "level_map_spot_border");
		m_spot_border_names[1] = g_uiSpotXml->ReadAttrib(path, 0, "spot_na", "");

		str = g_uiSpotXml->ReadAttrib(path, 0, "pointer", "");
		if( xr_strlen(str) )
		{
			if ( !bReload )
			{
				m_level_spot_pointer = xr_new<CMapSpotPointer>(this);
			}
			m_level_spot_pointer->Load(g_uiSpotXml,str);
		}else{
			VERIFY( !(bReload && m_level_spot_pointer) );
		}
	}

	strconcat(sizeof(path),path,path_base,":mini_map");
	node = g_uiSpotXml->NavigateToNode(path,0);
	if ( node )
	{
		LPCSTR str = g_uiSpotXml->ReadAttrib(path, 0, "spot", "");
		if( xr_strlen(str) )
		{
			if ( !bReload )
			{
				m_minimap_spot = xr_new<CMiniMapSpot>(this);
			}
			m_minimap_spot->Load(g_uiSpotXml,str);
		}else{
			VERIFY( !(bReload && m_minimap_spot) );
		}
		m_spot_border_names[2] = g_uiSpotXml->ReadAttrib(path, 0, "spot_a", "mini_map_spot_border");
		m_spot_border_names[3] = g_uiSpotXml->ReadAttrib(path, 0, "spot_na", "");

		str = g_uiSpotXml->ReadAttrib(path, 0, "pointer", "");
		if( xr_strlen(str) )
		{
			if ( !bReload )
			{
				m_minimap_spot_pointer = xr_new<CMapSpotPointer>(this);
			}
			m_minimap_spot_pointer->Load(g_uiSpotXml,str);
		}else{
			VERIFY( !(bReload && m_minimap_spot_pointer) );
		}
	}

	strconcat( sizeof(path), path, path_base, ":complex_spot" );
	node = g_uiSpotXml->NavigateToNode(path, 0);
	if ( node )
	{
		LPCSTR str = g_uiSpotXml->ReadAttrib(path, 0, "spot", "");
		if( xr_strlen(str) )
		{
			if ( !bReload )
			{
				m_complex_spot = xr_new<CComplexMapSpot>(this);
			}
			m_complex_spot->Load(g_uiSpotXml,str);
		}else{
			VERIFY( !(bReload && m_complex_spot) );
		}
		m_spot_border_names[4] = g_uiSpotXml->ReadAttrib(path, 0, "spot_a", "complex_map_spot_border");
		m_spot_border_names[5] = g_uiSpotXml->ReadAttrib(path, 0, "spot_na", "");

		str = g_uiSpotXml->ReadAttrib(path, 0, "pointer", "");
		if( xr_strlen(str) )
		{
			if ( !bReload )
			{
				m_complex_spot_pointer = xr_new<CMapSpotPointer>(this);
			}
			m_complex_spot_pointer->Load(g_uiSpotXml,str);
		}else{
			VERIFY( !(bReload && m_complex_spot_pointer) );
		}
	}

	if ( m_minimap_spot == NULL && m_level_spot == NULL && m_complex_spot == NULL )
	{
		DisableSpot();
	}
}
示例#22
0
void frmHint::SetHint(const wxArrayInt &_hintnos, const wxString &info)
{
	hintnos = _hintnos;
	SetHint(info);
}
示例#23
0
void frmHint::SetHint(int hintno, const wxString &info)
{
	hintnos.Add(hintno);
	SetHint(info);
};
示例#24
0
//---------------------------------------------------------------------------
void tTVPLayerManager::PrimaryMouseMove(tjs_int x, tjs_int y, tjs_uint32 flags)
{
	bool poschanged = (LastMouseMoveX != x || LastMouseMoveY != y);
	LastMouseMoveX = x;
	LastMouseMoveY = y;

	tTJSNI_BaseLayer *l;

	if(CaptureOwner)
		l = CaptureOwner;
	else
		l = GetMostFrontChildAt(x, y);

	// enter/leave event
	if(LastMouseMoveSent != l)
	{
		if(LastMouseMoveSent) LastMouseMoveSent->FireMouseLeave();

		// recheck l because the layer may become invalid during
		// FireMouseLeave call.
		if(CaptureOwner)
			l = CaptureOwner;
		else
			l = GetMostFrontChildAt(x, y);

		if(l)
		{
			InNotifyingHintOrCursorChange = true;
			try
			{
				tTJSNI_BaseLayer *ll;

				l->FireMouseEnter();

				// recheck l because the layer may become invalid during
				// FireMouseEnter call.
				if(CaptureOwner)
					ll = CaptureOwner;
				else
					ll = GetMostFrontChildAt(x, y);

				if(l != ll)
				{
					l->FireMouseLeave();
					l = ll;
					if(l) l->FireMouseEnter();
				}

				// note: rechecking is done only once to avoid infinite loop

				if(l) l->SetCurrentCursorToWindow();
				if(l) l->SetCurrentHintToWindow();
			}
			catch(...)
			{
				InNotifyingHintOrCursorChange = false;
				throw;
			}
			InNotifyingHintOrCursorChange = false;
		}

		if(!l)
		{
			SetMouseCursor(0);
			SetHint(NULL,ttstr());
		}
	}

	if(LastMouseMoveSent != l)
	{
		if(LastMouseMoveSent)
		{
			tTJSNI_BaseLayer *lay = LastMouseMoveSent;
			LastMouseMoveSent = NULL;
			if(lay->Owner) lay->Owner->Release();
		}

		LastMouseMoveSent = l;


		if(LastMouseMoveSent)
		{
			if(LastMouseMoveSent->Owner) LastMouseMoveSent->Owner->AddRef();
		}
	}

	if(l)
	{
		if(poschanged)
		{
			l->FromPrimaryCoordinates(x, y);
			l->FireMouseMove(x, y, flags);
		}
	}
	else
	{
		// no layer to send the event
	}
}