void CCandidateWindow::_NextPage()
{
	UINT uOldPage, uNewPage;

	GetCurrentPage(&uOldPage);
	uNewPage = uOldPage + 1;
	if(uNewPage >= _uPageCnt)
	{
		if(_pCandidateList != NULL)
		{
			if(_hwnd == NULL)
			{
				regwordul = TRUE;
			}

			if(!regword)
			{
				//辞書登録開始
				regword = TRUE;
				regwordtext.clear();
				regwordtextpos = 0;
				comptext.clear();
				regwordfixed = TRUE;

				_BackUpStatus();
				_ClearStatus();

				if(_pInputModeWindow != NULL)
				{
					_pInputModeWindow->_Show(TRUE);
				}
			}
			else
			{
				_CreateNext(TRUE);
			}

			_Update();
			return;
		}
	}

	_uIndex = _PageIndex[uNewPage];

	_dwFlags = TF_CLUIE_SELECTION;
	if(uNewPage != uOldPage)
	{
		_dwFlags |= TF_CLUIE_CURRENTPAGE;
	}

	_Update();
	_UpdateUIElement();
}
Exemplo n.º 2
0
STDAPI CCandidateWindow::SetSelection(UINT nIndex)
{
	UINT uOldPage, uNewPage;

	if(_pCandidateWindow)
	{
		return _pCandidateWindow->SetSelection(nIndex);
	}

	if(nIndex >= _uCount)
	{
		return E_INVALIDARG;
	}

	if(_ulsingle)
	{
		_Update();
	}
	else
	{
		GetCurrentPage(&uOldPage);
		_uIndex = nIndex;
		GetCurrentPage(&uNewPage);

		_dwFlags = TF_CLUIE_SELECTION;
		if(uNewPage != uOldPage)
		{
			_dwFlags |= TF_CLUIE_CURRENTPAGE;
		}

		_UpdateUIElement();
	}

	return S_OK;
}
Exemplo n.º 3
0
void Particle_Group::Init(){
	First_Run=false;
	ReloadShaders();
	Particle_Vertex v;
	v.pos = vec3(0, 0, 0);
	v.vel = vec3(0, 40, 0);
	v.Timer=0;
	v.Type=0;

	Graphics::Buffer particle_start;
	particle_start.Create(1, sizeof(Particle_Vertex), VERTEX_BUFFER, DEFAULT, CPU_NONE, &v);
	Particle_In.Create(MAX_PARTICLES, sizeof(Particle_Vertex), STREAM_BUFFER_OR_VERTEX_BUFFER);
	Particle_Out.Create(MAX_PARTICLES, sizeof(Particle_Vertex), STREAM_BUFFER_OR_VERTEX_BUFFER);
	CBuffer.Create(1, sizeof(cbuffer), CONSTANT_BUFFER);


    int iNumRandValues = 1024;
    srand( timeGetTime() );
	std::vector<float> ptr;
	ptr.resize(iNumRandValues * 4);
    for( int i = 0; i < iNumRandValues * 4; i++ )
    {
        ptr[i] = float( ( rand() % 10000 ) - 5000 );
    }
	Random_Tex.Create(&ptr[0], iNumRandValues, 1, 1, DEFAULT, CPU_NONE, NO_FLAG, FORMAT_RGBA32F);
	Particle_Tex.Create("particle.dds");
	particle_start.BindAsVertexBuffer();
	_Update(0.0f);
	Graphics::DrawVertices(1, 0);
	Graphics::Buffer::UnBindSOBuffer();
	Graphics::Buffer::UnBindVertexBuffer();
	std::swap(From, To);
}
void CCandidateWindow::_NextComp()
{
	UINT uOldPage, uNewPage;

	GetCurrentPage(&uOldPage);

	if(_uIndex + 1 >= _uCount)
	{
		return;
	}

	_InvokeSfHandler(SKK_NEXT_COMP);

	candidx++;

	_uIndex++;
	GetCurrentPage(&uNewPage);

	_dwFlags = TF_CLUIE_SELECTION;
	if(uNewPage != uOldPage)
	{
		_dwFlags |= TF_CLUIE_CURRENTPAGE;
	}

	_Update();
	_UpdateUIElement();
}
Exemplo n.º 5
0
int32
TreeTableSelectionModel::CountNodes()
{
	_Update();

	return fNodeCount;
}
void CCandidateWindow::_End()
{
	_preEnd = FALSE;

#ifndef _DEBUG
	if(_hwnd != NULL)
	{
		SetWindowPos(_hwnd, HWND_TOPMOST, 0, 0, 0, 0,
			SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW);
	}
	if(_pInputModeWindow != NULL)
	{
		_pInputModeWindow->_Show(TRUE);
	}
#endif

	if(_pCandidateWindow != NULL)
	{
		_pCandidateWindow->_Destroy();
	}
	SafeRelease(&_pCandidateWindow);

	if(_hwnd == NULL)
	{
		_dwFlags = TF_CLUIE_DOCUMENTMGR | TF_CLUIE_COUNT | TF_CLUIE_SELECTION |
			TF_CLUIE_STRING | TF_CLUIE_PAGEINDEX | TF_CLUIE_CURRENTPAGE;
		_Update();
		_UpdateUIElement();
	}
}
void
AddPrinterDialog::MessageReceived(BMessage* msg)
{
	switch(msg->what) {
		case B_OK:
			_AddPrinter(msg);
			PostMessage(B_QUIT_REQUESTED);
			break;

		case B_CANCEL:
			PostMessage(B_QUIT_REQUESTED);
			break;

		case kNameChangedMsg:
			fNameText = fName->Text();
			_Update();
			break;

		case kPrinterSelectedMsg:
			_StorePrinter(msg);
			break;

		case kTransportSelectedMsg:
			_HandleChangedTransport(msg);
			break;

		default:
			Inherited::MessageReceived(msg);
	}
}
Exemplo n.º 8
0
TreeTableNode*
TreeTableSelectionModel::_NodeAt(int32 index)
{
	_Update();

	return index >= 0 && index < fNodeCount ? fNodes[index] : NULL;
}
Exemplo n.º 9
0
void Particle_Group::Update(float dt){
	From->BindAsVertexBuffer();
	_Update(dt);
	Graphics::DrawAuto();
	Graphics::Buffer::UnBindSOBuffer();
	Graphics::Buffer::UnBindVertexBuffer();
	std::swap(From, To);
}
Exemplo n.º 10
0
int CKeyEdit::OnCreate(LPCREATESTRUCT lpCreateStruct) {
	if ( -1 == CEdit::OnCreate(lpCreateStruct) ) {
		return -1;
	}

	_Update( );
	return 0;
}
Exemplo n.º 11
0
// SetFixedValue
void
ColorField::SetFixedValue(float fixedValue)
{
	if (fFixedValue != fixedValue) {
		fFixedValue = fixedValue;
		_Update();
	}
}
Exemplo n.º 12
0
void FileDialog::_Ascend(void)
{
    if(_dirstack.size())
    {
        _dirstack.pop_back();
        _Update();
    }
}
//---------------------------------------------------------
void CWKSP_Data_Menu_Files::Recent_Del(int DataType, const wxString &FileName)
{
	if( m_bUpdate && _Get_Menu(DataType) )
	{
		_Get_Menu(DataType)->Del(FileName);

		_Update();
	}
}
Exemplo n.º 14
0
//!	This one calls _Update() if needed; BControl::SetTracking() isn't virtual.
void
BIconButton::_SetTracking(bool tracking)
{
	if (IsTracking() == tracking)
		return;

	SetTracking(tracking);
	_Update();
}
void CCandidateWindow::_BeginUIElement()
{
	BOOL bShow = TRUE;

	if(!_reg)
	{
		_InitList();
	}

	_Update();

	if((_hwnd == NULL) && (_depth == 0))
	{
		ITfUIElementMgr *pUIElementMgr;
		if(_pTextService->_GetThreadMgr()->QueryInterface(IID_PPV_ARGS(&pUIElementMgr)) == S_OK)
		{
			pUIElementMgr->BeginUIElement(this, &bShow, &_dwUIElementId);
			if(!bShow)
			{
				pUIElementMgr->UpdateUIElement(_dwUIElementId);
			}
			SafeRelease(&pUIElementMgr);
		}
	}

	if(_hwnd == NULL)
	{
		_bShow = FALSE;
	}
	else
	{
		_bShow = bShow;
	}

	if(_bShow)
	{
		if(_hwnd != NULL)
		{
			SetWindowPos(_hwnd, HWND_TOPMOST, 0, 0, 0, 0,
				SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE | SWP_SHOWWINDOW);

			if(_reg)
			{
				if(_pInputModeWindow != NULL)
				{
					_pInputModeWindow->_Show(TRUE);
				}
			}

			if(_depth == 0)
			{
				NotifyWinEvent(EVENT_OBJECT_IME_SHOW, _hwnd, OBJID_CLIENT, CHILDID_SELF);
			}
		}
	}
}
void
AddPrinterDialog::_StorePrinter(BMessage *msg)
{
	BString name;
	if (msg->FindString("name", &name) != B_OK)
		name = "";

	fPrinterText = name;
	_Update();
}
//---------------------------------------------------------
bool CWKSP_Module_Manager::Open(const wxString &File_Name)
{
	if( SG_Get_Module_Library_Manager().Add_Library(File_Name) )
	{
		_Update(false);

		return( true );
	}

	return( false );
}
Exemplo n.º 18
0
void FileDialog::Open(bool save, const char *opr /* = NULL */)
{
    if(isVisible())
        return;
    _operation = opr ? opr : "";
    resMgr.vfs.Reload(true); // refresh eventually changed files
    setVisible(true);
    _save = save;
    bOk->setCaption(save ? "Save" : "Open");
    _Update();
}
void CCandidateWindow::_UpdateComp()
{
	_comp = TRUE;
	candidates = _pTextService->candidates;
	candidx = _pTextService->candidx;
	searchkey = _pTextService->searchkey;

	_InitList();
	_Update();
	_UpdateUIElement();
}
Exemplo n.º 20
0
void
View::MessageReceived(BMessage* message)
{
	switch (message->what) {
		case kMsgUpdate:
			_Update();
			break;
		default:
			BView::MessageReceived(message);
			break;
	}
}
HRESULT CTextService::_HandleCharReturn(TfEditCookie ec, ITfContext *pContext, BOOL back)
{
	_EndCompletionList(ec, pContext);

	//terminate composition
	cursoridx = kana.size();
	_Update(ec, pContext, TRUE, back);
	_TerminateComposition(ec, pContext);
	_ResetStatus();

	return S_OK;
}
void CCandidateWindow::_PrevComp()
{
	UINT uOldPage, uNewPage;

	GetCurrentPage(&uOldPage);

	if(_uIndex == 0)
	{
		if(_pTextService->cx_stacompmulti && !_pTextService->cx_dyncompmulti)
		{
			_InvokeSfHandler(SKK_PREV_COMP);
			return;
		}
	}

	_InvokeSfHandler(SKK_PREV_COMP);

	if(_uIndex == 0)
	{
		candidx = (size_t)-1;
		_InitList();
		_Update();
		_UpdateUIElement();
		return;
	}

	candidx--;

	_uIndex--;
	GetCurrentPage(&uNewPage);

	_dwFlags = TF_CLUIE_SELECTION;
	if(uNewPage != uOldPage)
	{
		_dwFlags |= TF_CLUIE_CURRENTPAGE;
	}

	_Update();
	_UpdateUIElement();
}
Exemplo n.º 23
0
void
NetworkStatusView::MessageReceived(BMessage* message)
{
	switch (message->what) {
		case B_NETWORK_MONITOR:
			_Update();
			break;

		case kMsgShowConfiguration:
			_ShowConfiguration(message);
			break;

		case kMsgOpenNetworkPreferences:
			_OpenNetworksPreferences();
			break;

		case kMsgJoinNetwork:
		{
			const char* deviceName;
			const char* name;
			BNetworkAddress address;
			if (message->FindString("device", &deviceName) == B_OK
				&& message->FindString("name", &name) == B_OK
				&& message->FindFlat("address", &address) == B_OK) {
				BNetworkDevice device(deviceName);
				status_t status = device.JoinNetwork(address);
				if (status != B_OK) {
					BString text
						= B_TRANSLATE("Could not join wireless network:\n");
					text << strerror(status);
					BAlert* alert = new BAlert(name, text.String(),
						B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL,
						B_STOP_ALERT);
					alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
					alert->Go(NULL);
				}
			}
			break;
		}

		case B_ABOUT_REQUESTED:
			_AboutRequested();
			break;

		case B_QUIT_REQUESTED:
			_Quit();
			break;

		default:
			BView::MessageReceived(message);
	}
}
Exemplo n.º 24
0
void
BIconButton::_SetFlags(uint32 flags, bool set)
{
	if (_HasFlags(flags) != set) {
		if (set)
			fButtonState |= flags;
		else
			fButtonState &= ~flags;

		if ((flags & STATE_PRESSED) != 0)
			SetValueNoUpdate(set ? B_CONTROL_ON : B_CONTROL_OFF);
		_Update();
	}
}
Exemplo n.º 25
0
/*!	Called when the team's CPU time clock which this timer refers to has been
	set.

	The caller must hold \c time_lock and \c sUserTimerLock.

	\param changedBy The value by which the clock has changed.
*/
void
TeamTimeUserTimer::TimeWarped(bigtime_t changedBy)
{
	if (fTeam == NULL || changedBy == 0)
		return;

	// If this is a relative timer, adjust fNextTime by the value the clock has
	// changed.
	if (!fAbsolute)
		fNextTime += changedBy;

	// reschedule the kernel timer
	_Update(false);
}
Exemplo n.º 26
0
int vxl::Stoat() {
	int result = _CreateWindow();
	if (result != 0) return result;
	_Init();
	while (!glfwWindowShouldClose(m_window)) {
		// clear both depth and color each frame
		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
		_Update();
		_Render();
		glfwSwapBuffers(m_window);
		glfwPollEvents();
	}
	return 0;
}
Exemplo n.º 27
0
void CKeyEdit::OnKeyDown( UINT nChar, UINT /*nRepCnt*/, UINT /*nFlags*/ ) {
	//debug( _T("OnKeyDown: nChar=%u nRepCnt=%u nFlags=%08x\n"), nChar, nRepCnt, nFlags );

	if ( IsKeyDown( VK_MENU ) ) {
		return;
	}
	if ( IsKeyDown( VK_CONTROL ) ) {
		return;
	}
	if ( ! KEY_XALNUM( nChar ) )
		return;

	m_dwVk = (DWORD) nChar | ( IsKeyDown( VK_SHIFT ) ? 0x80000000UL : 0UL );
	_Update( );
}
Exemplo n.º 28
0
void
NetworkStatusView::AttachedToWindow()
{
	BView::AttachedToWindow();
	if (Parent())
		SetViewColor(Parent()->ViewColor());
	else
		SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));

	SetLowColor(ViewColor());

	start_watching_network(
		B_WATCH_NETWORK_INTERFACE_CHANGES | B_WATCH_NETWORK_LINK_CHANGES, this);

	_Update();
}
Exemplo n.º 29
0
/*!	Starts/stops the timer as necessary, if it is active.

	Called whenever threads of the team whose CPU time is referred to by the
	timer are scheduled or unscheduled (or leave the team), or when the timer
	was just set. Schedules a kernel timer for the remaining time, respectively
	cancels it.

	The caller must hold \c time_lock and \c sUserTimerLock.

	\param unscheduledThread If not \c NULL, this is the thread that is
		currently running and which is in the process of being unscheduled.
*/
void
TeamTimeUserTimer::Update(Thread* unscheduledThread)
{
	if (fTeam == NULL)
		return;

	// determine how many of the team's threads are currently running
	fRunningThreads = 0;
	int32 cpuCount = smp_get_num_cpus();
	for (int32 i = 0; i < cpuCount; i++) {
		Thread* thread = gCPU[i].running_thread;
		if (thread != unscheduledThread && thread->team == fTeam)
			fRunningThreads++;
	}

	_Update(unscheduledThread != NULL);
}
void
AddPrinterDialog::_HandleChangedTransport(BMessage *msg)
{
	BString name;
	if (msg->FindString("name", &name) != B_OK) {
		name = "";
	}
	fTransportText = name;

	BString path;
	if (msg->FindString("path", &path) == B_OK) {
		// transport path selected
		fTransportPathText = path;

		// mark sub menu
		void* pointer;
		if (msg->FindPointer("source", &pointer) == B_OK) {
			BMenuItem* item = (BMenuItem*)pointer;

			// Update printer name with Transport Path if not filled in
			if (strlen(fName->Text()) == 0)
				fName->SetText(item->Label());

			BMenu* menu = item->Menu();
			int32 index = fTransport->IndexOf(menu);
			item = fTransport->ItemAt(index);
			if (item != NULL)
				item->SetMarked(true);
		}
	} else {
		// transport selected
		fTransportPathText = "";

		// remove mark from item in sub menu of transport sub menu
		for (int32 i = fTransport->CountItems() - 1; i >= 0; i --) {
			BMenu* menu = fTransport->SubmenuAt(i);
			if (menu != NULL) {
				BMenuItem* item = menu->FindMarked();
				if (item != NULL)
					item->SetMarked(false);
			}
		}
	}
	_Update();
}