static pascal OSStatus ApplicationEventHandler(EventHandlerCallRef inHandlerCallRef, 
											   EventRef inEvent, void *inUserData)
	// Dispatches HICommands to their implementations.
{
	OSStatus 	err;
	HICommand 	command;
	#pragma unused(inHandlerCallRef)
	#pragma unused(inUserData)
	
	assert( GetEventClass(inEvent) == kEventClassCommand  );
	assert( GetEventKind(inEvent)  == kEventCommandProcess);
	
	err = GetEventParameter(inEvent, kEventParamDirectObject, typeHICommand, NULL, sizeof(command), NULL, &command);
	if (err == noErr) {
		switch (command.commandID) {
			case kHICommandAbout:
				DoAbout();
				break;
			case 'DShw':
				DoRefresh();
				break;
			case 'DAdd':
				DoAddTest();
				break;
			case 'DRem':
				DoRemoveTest();
				break;
			default:
				err = eventNotHandledErr;
				break;
		}
	}
	
	return err;
}
Ejemplo n.º 2
0
LRESULT CSyntaxView::OnBnClickedCheckFilter(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	DoDataExchange(true);

	DoRefresh(m_prevSyntaxMarker, 0);
	return 0;
}
Ejemplo n.º 3
0
WINAPI  GenerateGlobe( double dLat , double dLon, long nWidth, long nHeight, bool bLabel, bool bLocations, LPSTR szLocsFile,long dDay, long dNight, long dTerm, bool bShade, bool bStars, bool bGrid, long lTime, long lSatLat, long lSatLon, LPSTR szSatName, SAFEARRAY **psaLat,SAFEARRAY **psaLon, SAFEARRAY **psaColour)
{
	long i;
	long lElements;

    double *pTrackLats;
	double *pTrackLons;
	COLORREF *pTrackColour;
      
	Settings.pos.type = Position::fixed;
	Settings.pos.latitude = dLat;
	Settings.pos.longitude = dLon;
	Settings.size.cx = nWidth;
	Settings.size.cy = nHeight;
	Settings.label = bLabel;
	Settings.labelpos = 1;
	Settings.markers = bLocations;
	strcpy(Settings.szMarkerPath,szLocsFile);
	Settings.stars = bStars;
	Settings.grid = bGrid;

	Settings.shade = bShade;
	Settings.day = dDay;
	Settings.night = dNight;
	Settings.term = dTerm;
	Settings.time = lTime;

	Settings.satpos.lat = lSatLat;
	Settings.satpos.lon = lSatLon;
	Settings.satpos.label = (char *)szSatName;

//	Settings.bDisplayondesktop = bDeskTop;

	// how many elements are there in the array
	lElements=(*psaLat)->rgsabound[0].cElements;
	if (lElements>500)
		lElements = 500;

	Settings.lElements = lElements;

	pTrackLats=(double*) (*psaLat)->pvData;
	pTrackLons=(double*) (*psaLon)->pvData;
	pTrackColour = (COLORREF *) (*psaColour)->pvData;
	
	for (i=0;i<lElements;i++)
	{
		Settings.satTrack[i].lat = pTrackLats[i];
		Settings.satTrack[i].lon = pTrackLons[i];
		Settings.satTrack[i].lColour = pTrackColour[i];
	}
	Settings.LoadMarkers(false);
	
	
	return DoRefresh();
}
Ejemplo n.º 4
0
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR lpszCmdLine, int nCmdShow)
{
	char szLabel[100];
	int i;

	Settings.pos.type = Position::fixed;
	Settings.pos.latitude = 52;
	Settings.pos.longitude = 0;
//	Settings.size.cx = nWidth;
//	Settings.size.cy = nHeight;
	Settings.label = true;
	Settings.labelpos = 1;
	Settings.markers = true;
	Settings.stars = true;
	Settings.grid = true;

	Settings.shade = true;
//	Settings.day = dDay;
//	Settings.night = dNight;
//	Settings.term = dTerm;
//	Settings.time = lTime;

	Settings.satpos.lat = 54;
	Settings.satpos.lon = 12;
	strcpy(szLabel,"AO-40");
	strcpy(Settings.szMarkerPath,"built-in");
	Settings.satpos.label = (char *)szLabel;
	Settings.lElements = 500;
	for (i=0;i<500;i++)
	{
		Settings.satTrack[i].lat = i;
		Settings.satTrack[i].lon = 1;
		Settings.satTrack[i].lColour = i;
	}
	Settings.LoadMarkers(false);
	DoRefresh();

//	TestAgSgp();

	return 0;
} 
static void DoRemoveTest(void)
	// Called in response to a click of the "Remove" button. 
{
	OSStatus	err;
	CFIndex 	itemCount;
	CFIndex 	itemIndex;
	Boolean		found;
	
	// Find the index of the selected item in the data browser 
	// control.
	
	itemCount = CFArrayGetCount(gItems);
	itemIndex = 0;
	found = false;
	while ( (itemIndex < itemCount) && ! found ) {
		found = IsDataBrowserItemSelected(gDataControl, (DataBrowserItemID) itemIndex + 1);;
		
		if ( ! found ) {
			itemIndex += 1;
		}
	}
	
	// Use LIAE to remove it.
	
	if (found) {
		err = LIAERemove(itemIndex);
	} else {
		// It's not an error to have no selection because we don't dynamically 
		// enable/disable the Remove button.
		err = noErr;
	}
	
	if (err == noErr) {
		DoRefresh();
	} else {
		DisplayError(err);
	}	
}
Ejemplo n.º 6
0
void View::SetPage(int pageIdx, bool doLayout)
{
    assert(m_doc); // Page cannot be NULL
    assert(m_doc->HasPage(pageIdx));

    m_pageIdx = pageIdx;
    m_currentPage = m_doc->SetDrawingPage(pageIdx);

    if (doLayout) {
        m_doc->CollectScoreDefs();
        // if we once deal with multiple views, it would be better
        // to redo the layout only when necessary?
        m_currentPage->LayOut();
    }

    m_currentElement = NULL;
    m_currentLayer = NULL;
    m_currentMeasure = NULL;
    m_currentStaff = NULL;
    m_currentSystem = NULL;

    OnPageChange();
    DoRefresh();
}
Ejemplo n.º 7
0
Archivo: flash.c Proyecto: FTCr/sie-elf
void GetFF()
{
  char fname[256];
  TDate date;
  TTime time;
  GetDateTime(&date, &time);
  sprintf(fname,"%s\\FF_%02d%02d%d_%02d%02d.bin",_CurPath, date.day, date.month, date.year,time.hour,time.min);
  int f,

#ifdef NEWSGOLD
  size=0x4000000;
#else
  size=0x2000000;
#endif  
  
  Busy = 1;
  initprogr(ind_rec);
  progr_max=1;
  incprogr(0);
  
  if(fname && (f=_open(fname,A_WriteOnly+A_BIN+A_Create+A_Truncate,P_WRITE,&err))!=-1)
  {
    fwrite32(f,(char*)0xA0000000,size,&err);
    _close(f,&err);
  }
  
  if(progr_stop) fsrm(fname, 0);
  
  DoRefresh();
  //�שול ןונג�י פאיכ
  int ind = GetCurTabFileIndex(GetFileName(fname));
  SetCurTabIndex(ind, 0);
  
  endprogr();
  Busy = 0;
}
Ejemplo n.º 8
0
LRESULT CSyntaxView::OnRefresh(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam)
{
	DoRefresh(reinterpret_cast<ISciSyntaxMarker *>(wParam), lParam);
	return 0;
}
static OSStatus SetupUserInterface(void)
	// Create a user interface from our NIB.
{
	OSStatus 	err;
	IBNibRef 	nibRef;
	Handle		menuBar;

	nibRef  = NULL;
	menuBar = NULL;
		
	err = CreateNibReference(CFSTR("LoginItemsAETest"), &nibRef);
	if (err == noErr) {
		err = CreateMenuBarFromNib(nibRef, CFSTR("MenuBar"), &menuBar);
	}
	if (err == noErr) {
		SetMenuBar(menuBar);
	}
	if (err == noErr) {
		err = CreateWindowFromNib(nibRef, CFSTR("MainWindow"), &gMainWindow);
	}
	if (err == noErr) {
		ControlID theID;

		theID.signature = 'HDCB';
		theID.id = 0;	

		err = GetControlByID(gMainWindow, &theID, &gAddHiddenControl);
	}

	// Find and set up the data browser control.
	
	if (err == noErr) {
		ControlID theID;

		theID.signature = 'DATA';
		theID.id = 0;	

		err = GetControlByID(gMainWindow, &theID, &gDataControl);
	}
	if (err == noErr) {
		DataBrowserCallbacks callbacks;
		
		callbacks.version = kDataBrowserLatestCallbacks;
		err = InitDataBrowserCallbacks(&callbacks);

		if (err == noErr) {
			callbacks.u.v1.itemDataCallback = NewDataBrowserItemDataUPP(DataBrowserDataCallback);

			err = SetDataBrowserCallbacks(gDataControl, &callbacks);
		}
	}
	if (err == noErr) {
		DoRefresh();
	}
	
	if (err == noErr) {
		ShowWindow(gMainWindow);
	}
  	
	if (nibRef != NULL) {
		DisposeNibReference(nibRef);
	}
	if (menuBar != NULL) {
		DisposeHandle(menuBar);
	}
	return err;
}
static pascal void AddNavEvent(
	NavEventCallbackMessage callBackSelector, 
	NavCBRecPtr 			callBackParms, 
	void *					callBackUD
)
	// Called by Navigation Services when interesting things happen 
	// in our Nav dialog (which is displayed when the user clicks 
	// the "Add" button).  In this case we're primarily interested 
	// in two events: the user action of the user clicking the Choose 
	// button of the Nav dialog, and the dialog being torn down.
{
	#pragma unused(callBackUD)
	OSStatus		err;
	OSStatus		junk;
	NavDialogRef 	navDialog;
	
	navDialog = callBackParms->context;
	assert(navDialog != NULL);
	
	switch (callBackSelector) {
		case kNavCBUserAction:
			switch ( NavDialogGetUserAction(navDialog) ) {
				case kNavUserActionChoose:
					{
						NavReplyRecord 	reply;
						AEKeyword 		junkKeyword;
						DescType		junkType;
						Size			junkSize;
						
						err = NavDialogGetReply(navDialog, &reply);
						if (err == noErr) {
							FSRef	chosenItem;
							
							// In the debug build, verify that only one items is 
							// selected.
							
							#if ! defined(NDEBUG)
								{
									long selectionCount;
									
									assert( 
										   (AECountItems( &reply.selection, &selectionCount) == noErr)
										&& (selectionCount == 1)
									);
								}
							#endif

							// Get the selected item.
							
							err = AEGetNthPtr(
								&reply.selection, 
								1, 
								typeFSRef, 
								&junkKeyword, 
								&junkType, 
								&chosenItem, 
								sizeof(chosenItem), 
								&junkSize
							);
							
							// Use LoginItemsAE to add it to the list.
							
							if (err == noErr) {
								err = LIAEAddRefAtEnd(
									&chosenItem, 
									GetControlValue(gAddHiddenControl) != 0
								);
							}
						
							junk = NavDisposeReply(&reply);
							assert(junk == noErr);
							
							if (err == noErr) {
								DoRefresh();
							} else {
								DisplayError(err);
							}						
						}
					}
					break;
				default:
					// do nothing
					break;
			}
			break;
		case kNavCBTerminate:
			NavDialogDispose(navDialog);
			break;
		default:
			// do nothing
			break;
	}
}
Ejemplo n.º 11
0
LRESULT CBookmarksView::OnRefresh(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam)
{
    DoRefresh(reinterpret_cast<ISciBookmarksMarker *>(wParam), lParam);
    return 0;
}
Ejemplo n.º 12
0
void CBookmarksView::OnLoadFile(bool mergeFlag)
{
    if (m_list.GetItemCount() > 0)
    {
        if (mergeFlag) {
            if (MessageBox(LOAD_MERGE_BOOKMARKS_MSG, _T("Warning"), MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2) != IDYES)
            {
                return;
            }
        }
        else if (MessageBox(LOAD_BOOKMARKS_MSG, _T("Warning"), MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2) != IDYES)
        {
            return;
        }
    }

    CUnicodeFile file;
    std::_tstring xmlStr;
    file.Open(BookmarksFilePath());
    if (file.IsOpen())
    {
        file.Read(xmlStr);
        file.Close();

        BOOL bResult = FALSE;
        std::_tstring bookmarks;
        int index = 0;

        bookmarks = FindTag(xmlStr, _T("bookmarks"), index);

        if (index >= 0)
        {
            index = 0;
            int col = 0;

            if (!mergeFlag)
            {
                m_listMaster.DeleteAllItems();
            }

            std::_tstring bookmark, line, type, user, lineNum, column, module, attribute, attributeType, description;

            while (index >= 0)
            {
                bookmark = FindTag(bookmarks, _T("bookmark"), index);

                if (index >= 0)
                {
                    int bookmarkIndex = 0;

                    lineNum = FindTag(bookmark, _T("line"), bookmarkIndex);
                    type = FindTag(bookmark, _T("type"), bookmarkIndex);
                    column = FindTag(bookmark, _T("column"), bookmarkIndex);
                    user = FindTag(bookmark, _T("user"), bookmarkIndex);
                    module = FindTag(bookmark, _T("module"), bookmarkIndex);
                    attribute = FindTag(bookmark, _T("attribute"), bookmarkIndex);
                    attributeType = FindTag(bookmark, _T("attrtype"), bookmarkIndex);
                    description = FindTag(bookmark, _T("description"), bookmarkIndex);

                    bool foundDupe = false;
                    for (int i = 0; i < m_listMaster.GetItemCount(); ++i)
                    {
                        std::_tstring lineDupe = m_listMaster.GetItemText(i, 0);
                        std::_tstring moduleDupe = m_listMaster.GetItemText(i, 3);
                        std::_tstring attributeDupe = m_listMaster.GetItemText(i, 4);

                        if (lineDupe == lineNum && moduleDupe == module && attributeDupe == attribute)
                        {
                            foundDupe = true;
                        }
                    }

                    if (!foundDupe) {
                        if (lineNum.length() > 0 && attribute.length() > 0 && description.length() > 0)
                        {
                            int row = 0;
                            col = 0;
                            row = m_listMaster.InsertItem(col++, lineNum.c_str());
                            m_listMaster.SetItemText(row, col++, type.c_str());
                            m_listMaster.SetItemText(row, col++, user.c_str());
                            m_listMaster.SetItemText(row, col++, module.c_str());
                            m_listMaster.SetItemText(row, col++, attribute.c_str());
                            m_listMaster.SetItemText(row, col++, attributeType.c_str());
                            m_listMaster.SetItemText(row, col++, description.c_str());
                            BookmarkItemData *data = new BookmarkItemData;
                            data->marked = true;
                            data->bookmarkType = m_listMaster.StringToType(type);
                            data->column = boost::lexical_cast<int>(column);
                            m_listMaster.SetItemData(row, (DWORD_PTR)data);
                        }
                    }
                }
            }

            for (int i = 0; i < col; ++i) {
                m_list.SetColumnWidth(i, LVSCW_AUTOSIZE_USEHEADER);
            }
        }

        DoRefresh(NULL, 0);
    }
    else
    {
        MessageBox(LOAD_UNFOUND_BOOKMARKS_MSG, _T("Warning"));
    }
}
Ejemplo n.º 13
0
void CBookmarksView::ParseBookmarksEcl(std::_tstring ecl, std::_tstring user, std::_tstring inModule, std::_tstring inAttributeName, IAttributeType *attrType)
{
    int i = 0;
    int col = 0;
    int row = 0;

    std::_tstring bookmark = _T("");

    SetMarks(inModule, inAttributeName, false);

    for (int b = 0; b < (int)m_listMaster.m_bookmarks.size(); b++)
    {
        bookmark = m_listMaster.m_bookmarks[b];
        if (bookmark.length() == 0) {
            continue;
        }

        int n = static_cast<int>(ecl.find(bookmark, i));

        if (n > 0) {
            std::_tstring line;
            int index = 0;
            bool found = false;

            typedef std::vector<std::_tstring> split_vector_type;
            split_vector_type lines;
            boost::algorithm::split(lines, ecl, boost::algorithm::is_any_of(_T("\n")), boost::algorithm::token_compress_on);

            for (split_vector_type::const_iterator itr = lines.begin(); itr != lines.end(); ++itr)
            {
                line = itr[0];
                ++index;

                n = static_cast<int>(line.find(_T("//"), 0));
                if (n < 0)
                {
                    continue;
                }

                n = static_cast<int>(line.find(bookmark, 0));

                if (n >= 0) {
                    col = 0;

                    std::wostringstream ss;
                    ss << (index);
                    std::_tstring nStr = ss.str();
                    found = false;

                    for (int i = 0; i < m_listMaster.GetItemCount(); ++i)
                    {
                        std::_tstring liner = m_listMaster.GetItemText(i, 0);
                        std::_tstring module = m_listMaster.GetItemText(i, 3);
                        std::_tstring attributeName = m_listMaster.GetItemText(i, 4);

                        if (liner == nStr && module == inModule && attributeName == inAttributeName)
                        {
                            found = true;
                            BookmarkItemData *data = reinterpret_cast<BookmarkItemData *>(m_listMaster.GetItemData(i));
                            data->marked = true;
                            break;
                        }
                    }

                    if (!found) {
                        row = m_listMaster.InsertItem(col++, nStr.c_str());
                        m_listMaster.SetItemText(row, col++, bookmark.c_str());
                        m_listMaster.SetItemText(row, col++, user.c_str());
                        m_listMaster.SetItemText(row, col++, inModule.c_str());
                        m_listMaster.SetItemText(row, col++, inAttributeName.c_str());
                        m_listMaster.SetItemText(row, col++, attrType->GetRepositoryCode());
                        m_listMaster.SetItemText(row, col++, trim(line.substr(n + m_listMaster.m_bookmarks[b].length())).c_str());
                        BookmarkItemData *data = new BookmarkItemData;
                        data->marked = true;
                        data->bookmarkType = (BM_TYPE)b;
                        data->column = n;
                        m_listMaster.SetItemData(row, (DWORD_PTR)data);
                    }
                }
            }
        }
    }

    DeleteMarkedBookmarks(inModule, inAttributeName,false);

    for (int i = 0; i < col; ++i)
    {
        m_listMaster.SetColumnWidth(i, LVSCW_AUTOSIZE_USEHEADER);
    }

    DoRefresh(NULL, 0);
}
Ejemplo n.º 14
0
/*---------------------------------------------------------------------------*/
void wxPanelData::OnMnuRefreshClick(wxCommandEvent& event)
{
   DoRefresh(true);
}
Ejemplo n.º 15
0
LRESULT CSummaryView::OnRefresh(UINT /*uMsg*/, WPARAM /*bCreated*/, LPARAM /*lParam*/)
{
    DoRefresh();
    return 0;
}