예제 #1
0
파일: nmake.c 프로젝트: mingpen/OpenNT
LOCAL void NEAR
loadBuiltInRules(void)
{
    char *tempTarg;
    char **tempCom;
    unsigned index;
    char *macroName, *macroValue;
    extern char *makestr;


    /* We dynamically allocate CC and AS because they need to be freed in a
     * recursive MAKE
     */
    macroName = makeString("CC");
    macroValue = makeString("cl");
    defineMacro(macroName, macroValue, 0);
    macroName = makeString("CXX");
    macroValue = makeString("cl");
    defineMacro(macroName, macroValue, 0);
    macroName = makeString("CPP");
    macroValue = makeString("cl");
    defineMacro(macroName, macroValue, 0);
    macroName = makeString("AS");
    macroValue = makeString("ml");
    defineMacro(macroName, macroValue, 0);
    macroName = makeString("BC");
    macroValue = makeString("bc");
    defineMacro(macroName, macroValue, 0);
    macroName = makeString("COBOL");
    macroValue = makeString("cobol");
    defineMacro(macroName, macroValue, 0);
    macroName = makeString("FOR");
    macroValue = makeString("fl");
    defineMacro(macroName, macroValue, 0);
    macroName = makeString("PASCAL");
    macroValue = makeString("pl");
    defineMacro(macroName, macroValue, 0);
    macroName = makeString("RC");
    macroValue = makeString("rc");
    defineMacro(macroName, macroValue, 0);
    macroName = makeString("MAKE");
    macroValue = makeString(makeStr);
    /* From environment so it won't get exported ; user can reset MAKE
     */
    defineMacro(macroName, macroValue, M_ENVIRONMENT_DEF|M_WARN_IF_RESET);

    for (index = 0; tempTarg = builtInTarg[index]; index++) {
	 name = makeString(tempTarg);
	 _ftcscpy(buf, ":");
	 endNameList();
	 for (tempCom=builtInCom[index];*tempCom;tempCom++) {
	      _ftcscpy(buf, *tempCom);
	      addItemToList();
	 }
	 if (index == 0)
	     assignDependents();
	 assignBuildCommands();
    }

}
예제 #2
0
PurchaseEditor::PurchaseEditor( QWidget *parent)
: KDialog( parent )
{
    ui = new PurchaseEditorUI( this );
    setMainWidget( ui );
    setCaption( i18n("Purchase") );
    setButtons( KDialog::Ok|KDialog::Cancel );
    setDefaultButton(KDialog::None);

    ui->editDonor->setCustomLayout(1);

    ui->btnAddItem->setDefault(true);

    connect( ui->btnAddItem, SIGNAL( clicked() ), this, SLOT( addItemToList() ) );

    connect(ui->btnRemoveItem, SIGNAL( clicked() ), SLOT( deleteSelectedItem() ) );

    ui->chIsAGroup->setDisabled(true);

    
    QString path = KStandardDirs::locate("appdata", "styles/");
    path = path+"tip.svg";
    errorPanel = new MibitTip(this, ui->widgetPurchase, path, DesktopIcon("dialog-warning",32) );
    

    lastCode = "";
    status = estatusNormal;
    productExists = false;
    productsHash.clear();
    resetEdits();
    totalBuy = 0.0;
    itemCount = 0.0;
    ui->editDateTime->setDateTime(QDateTime::currentDateTime());
    QTimer::singleShot(500, this, SLOT(setupTable()));
}
예제 #3
0
PurchaseEditor::PurchaseEditor( QWidget *parent )
: KDialog( parent )
{
    ui = new PurchaseEditorUI( this );
    setMainWidget( ui );
    setCaption( i18n("Purchase") );
    setButtons( KDialog::Ok|KDialog::Cancel );
    setDefaultButton(KDialog::None);
    ui->btnAddItem->setDefault(true);

    //Set Validators for input boxes
    QRegExp regexpC("[0-9]{1,13}"); //(EAN-13 y EAN-8) .. y productos sin codigo de barras?
    QRegExpValidator * validatorEAN13 = new QRegExpValidator(regexpC, this);
    ui->editCode->setValidator(validatorEAN13);
    ui->editTax->setValidator(new QDoubleValidator(0.00, 999999999999.99, 3,ui->editTax));
    ui->editExtraTaxes->setValidator(new QDoubleValidator(0.00, 999999999999.99, 3,ui->editExtraTaxes));
    ui->editCost->setValidator(new QDoubleValidator(0.00, 999999999999.99, 3, ui->editCost));
    ui->editPoints->setValidator(new QIntValidator(0,999999999, ui->editPoints));
    ui->editFinalPrice->setValidator(new QDoubleValidator(0.00,999999999999.99, 3, ui->editFinalPrice));
    ui->editItemsPerBox->setValidator(new QDoubleValidator(0.00,999999999999.99, 2, ui->editItemsPerBox));
    ui->editPricePerBox->setValidator(new QDoubleValidator(0.00,999999999999.99, 2, ui->editPricePerBox));
    ui->editQty->setValidator(new QDoubleValidator(0.00,999999999999.99, 2, ui->editQty));

    connect( ui->btnPhoto          , SIGNAL( clicked() ), this, SLOT( changePhoto() ) );
    connect( ui->btnCalculatePrice , SIGNAL( clicked() ), this, SLOT( calculatePrice() ) );
    connect( ui->editItemsPerBox , SIGNAL( textEdited(const QString &) ), this, SLOT( calculatePrice() ) );
    connect( ui->editPricePerBox , SIGNAL( textEdited(const QString &) ), this, SLOT( calculatePrice() ) );
    connect( ui->editCost , SIGNAL( textEdited(const QString &) ), this, SLOT( calculatePrice() ) );
    connect( ui->editTax , SIGNAL( textEdited(const QString &) ), this, SLOT( calculatePrice() ) );
    connect( ui->editExtraTaxes , SIGNAL( textEdited(const QString &) ), this, SLOT( calculatePrice() ) );
    connect( ui->editUtility , SIGNAL( textEdited(const QString &) ), this, SLOT( calculatePrice() ) );
    connect( ui->editCode, SIGNAL(textEdited(const QString &)), SLOT(checkIfCodeExists()));
    connect( ui->editCode, SIGNAL(returnPressed()), ui->editQty, SLOT(setFocus()));
    connect( ui->btnAddItem, SIGNAL( clicked() ), this, SLOT( addItemToList() ) );
    connect(ui->groupBoxedItem, SIGNAL(toggled(bool)), this, SLOT(focusItemsPerBox(bool)) );

    connect(ui->btnRemoveItem, SIGNAL( clicked() ), SLOT( deleteSelectedItem() ) );

    ui->chIsAGroup->setDisabled(true);
    

    status = estatusNormal;
    productExists = false;
    productsHash.clear();
    resetEdits();
    totalBuy = 0.0;
    itemCount = 0.0;
    totalTaxes = 0.0;
    QTimer::singleShot(500, this, SLOT(setupTable()));
}
void XAP_Win32Dialog_PluginManager::refreshPluginList()
{	
	// Clear List Box
	resetContent( XAP_RID_DIALOG_PLUGIN_MANAGER_LBX_LIST );

	// Populate List Box
	XAP_Module* pModule = 0;
	const UT_GenericVector<class XAP_Module *> *pVec = XAP_ModuleManager::instance().enumModules();

	for (UT_sint32 i = 0; i < pVec->size(); i++)
	{
        pModule = (XAP_Module *)pVec->getNthItem (i);
		addItemToList( XAP_RID_DIALOG_PLUGIN_MANAGER_LBX_LIST, pModule->getModuleInfo()->name );
	}
}
예제 #5
0
/*********************************************************************
* initDirect3D
* initializes direct3D
*********************************************************************/
bool initDirect3D()
{
	pD3D = NULL;

	// create the directX object
	if( NULL == ( pD3D = Direct3DCreate9( D3D_SDK_VERSION ) ) )
	{
		return false;
	}

	// this section gets the adapter details
	D3DADAPTER_IDENTIFIER9 ident;
	pD3D->GetAdapterIdentifier(D3DADAPTER_DEFAULT, 0, &ident);	
	addItemToList("Adapter Details");
	addItemToList(ident.Description);
	addItemToList(ident.DeviceName);
	addItemToList(ident.Driver);
	
	// collects how many modes this adapter has
	UINT numModes = pD3D->GetAdapterModeCount(D3DADAPTER_DEFAULT, D3DFMT_X8R8G8B8);
	for (UINT i=0; i<numModes-1; i++)
	{
		D3DDISPLAYMODE mode;
		char modeString[255];
		// get the displaymode structure for this adapter mode
		pD3D->EnumAdapterModes(D3DADAPTER_DEFAULT, D3DFMT_X8R8G8B8, i, &mode);

		// draw a blank line in the listbox
		addItemToList("");
		// output the width
		sprintf(modeString, "Width=%d",mode.Width);
		addItemToList(modeString);
		// output the height
		sprintf(modeString, "Height=%d",mode.Height);		
		addItemToList(modeString);
		// output the refreshrate
		sprintf(modeString, "RefreshRate=%d",mode.RefreshRate);		
		addItemToList(modeString);		
	}	
	
	return true;
}
예제 #6
0
파일: dmm.c 프로젝트: konorati/OldProjects
/*************************************************************************
* Date last modified: June 16th, 2013
* Description: Resorts list in user determined way
* Input parameters: List pointer, user determined sorting type
* Returns: new pointer to list
* Precondition: List must exist
* Postcondition: Valid list pointer is returned to newly sorted list
*************************************************************************/
List* resortList(List *pList, int sortType)
{
	List *pNewList = NULL;
	Node* conductor = pList->pStart;
	Node* tempNode = NULL;
	pNewList = initList();

	while(NULL != conductor)
	{
		pList->pStart = pList->pStart->pNext;
		conductor->pNext = NULL;
		conductor->pPrevious = NULL;
		addItemToList(&pNewList, &conductor, sortType);
		conductor = pList->pStart;
	}
	free(pList);
	return pNewList;
}
BOOL AP_Win32Dialog_InsertHyperlink::_onInitDialog(HWND hWnd, WPARAM /*wParam*/, LPARAM /*lParam*/)
{
	const XAP_StringSet* pSS = m_pApp->getStringSet();

	// Update the caption
	setDialogTitle(pSS->getValue(AP_STRING_ID_DLG_InsertHyperlink_Title));

	/* Localise controls*/
	_DSX(INSERTHYPERLINK_BTN_OK,			DLG_OK);
	_DSX(INSERTHYPERLINK_BTN_CANCEL,		DLG_Cancel);
	_DS(INSERTHYPERLINK_LBL_MSG,			DLG_InsertHyperlink_Msg);

	// initial data
	resetContent(AP_RID_DIALOG_INSERTHYPERLINK_LBX_LINK);

	UT_uint32 count = getExistingBookmarksCount();
	for( UT_uint32 i = 0; i < count; i++)
	{
		addItemToList( AP_RID_DIALOG_INSERTHYPERLINK_LBX_LINK,
                       getNthExistingBookmark( i ) );
	}

	SetFocus(GetDlgItem(hWnd,AP_RID_DIALOG_INSERTHYPERLINK_EBX_LINK));

	const gchar * hyperlink = getHyperlink();

	if(hyperlink)
	{
		if(hyperlink[0]=='#')  //ignore the anchor for internal bookmarks
		{
			setControlText(AP_RID_DIALOG_INSERTHYPERLINK_EBX_LINK, hyperlink+1);
		}
		else
		{
			setControlText(AP_RID_DIALOG_INSERTHYPERLINK_EBX_LINK, hyperlink);
		}
		selectControlText(AP_RID_DIALOG_INSERTHYPERLINK_EBX_LINK, 0, -1);
	}

	centerDialog();	
	return 0; // 0 because we called set focus
}
예제 #8
0
void OpenCachingModel::parseFile( const QByteArray& file )
{
    QXmlStreamReader reader( file );
    QXmlStreamReader::TokenType token;
    QHash<int, OpenCachingCache> caches;
    QHash<int, QHash<QString, OpenCachingCacheDescription> > descriptions;
    QHash<int, OpenCachingCacheLog> logs;

    while( !reader.atEnd() && !reader.hasError() ) {
        token = reader.readNext();
        if( token == QXmlStreamReader::StartDocument ) {
            continue;
        }
        if( token == QXmlStreamReader::StartElement ) {
            if( reader.name() == "cache" ) {
                OpenCachingCache cache = d->parseCache( reader );
                caches[cache.id()] = cache;
            }
            else if( reader.name() == "cachedesc" ) {
                OpenCachingCacheDescription description = d->parseDescription( reader );
                descriptions[description.cacheId()][description.language()] = description;
            }
            else if( reader.name() == "cachelog" ) {
                OpenCachingCacheLogEntry logEntry = d->parseLogEntry( reader );
                logs[logEntry.cacheId()].addLogEntry( logEntry );
            }
        }
    }

    foreach( const int key, caches.keys() ) {
        if( caches[key].difficulty() >= m_minDifficulty &&
            caches[key].difficulty() <= m_maxDifficulty )
        {
            caches[key].setDescription( descriptions[key] );
            caches[key].setLog( logs[key] );
            addItemToList( new OpenCachingItem( caches[key], this ) );
        }
    }
}
BOOL XAP_Win32Dialog_WindowMore::_onInitDialog(HWND /*hWnd*/, WPARAM /*wParam*/, LPARAM /*lParam*/)
{
	// localize controls
	localizeDialogTitle(XAP_STRING_ID_DLG_MW_MoreWindows);

	localizeControlText(XAP_RID_DIALOG_WINDOWMORE_TEXT_ACTIVATE,	XAP_STRING_ID_DLG_MW_Activate);
	localizeControlText(XAP_RID_DIALOG_WINDOWMORE_BTN_OK,			XAP_STRING_ID_DLG_OK);
	localizeControlText(XAP_RID_DIALOG_WINDOWMORE_BTN_CANCEL,		XAP_STRING_ID_DLG_Cancel);

	// load each frame name into the list
	for (UT_sint32 i=0; i<m_pApp->getFrameCount(); i++)
	{
		XAP_Frame * f = m_pApp->getFrame(i);
		UT_continue_if_fail(f);

		int nIndex = addItemToList(XAP_RID_DIALOG_WINDOWMORE_LIST, f->getTitle().utf8_str());
		setListDataItem(XAP_RID_DIALOG_WINDOWMORE_LIST, nIndex, (DWORD) i);
     } 

	// select the one we're in
	selectListItem(XAP_RID_DIALOG_WINDOWMORE_LIST, m_ndxSelFrame);

	return 1;							// 1 == we did not call SetFocus()
}
예제 #10
0
static void setupScrollLists(int dontChange, xfselControlBlkType ctrlBlk)
{
    char        *itemBuf1[MAX_ENTRIES_IN_LIST];
    char        *itemBuf2[MAX_ENTRIES_IN_LIST];
    char        *itemBuf3[MAX_ENTRIES_IN_LIST];
    int         itemCount1, itemCount2, itemCount3;
    char        buff1[TEMP_BUF_SIZE];
    XmString    items[MAX_ENTRIES_IN_LIST];
    int         i;

    itemCount1 = 0;
    itemCount2 = 0;
    itemCount3 = 0;

    for (i = 0; i < ctrlBlk.numFonts && i < MAX_ENTRIES_IN_LIST; i++)
    {
        if ((dontChange != FONT) &&
            (styleMatch(&ctrlBlk, ctrlBlk.fontData[i])) &&
            (sizeMatch (&ctrlBlk, ctrlBlk.fontData[i])) &&
            ((ctrlBlk.showPropFonts == PREF_PROP) || 
             (notPropFont(ctrlBlk.fontData[i]))))
        {
            getFontPart(ctrlBlk.fontData[i], buff1);
            addItemToList(itemBuf1, buff1, &itemCount1);
        }

        if ((dontChange != STYLE) &&
            (fontMatch(&ctrlBlk, ctrlBlk.fontData[i])) &&
            (sizeMatch (&ctrlBlk, ctrlBlk.fontData[i])) &&
            ((ctrlBlk.showPropFonts == PREF_PROP) || 
             (notPropFont(ctrlBlk.fontData[i]))))
        {
            getStylePart(ctrlBlk.fontData[i], buff1);
            addItemToList(itemBuf2, buff1, &itemCount2);
        }

        if ((dontChange != SIZE) &&
            (fontMatch(&ctrlBlk, ctrlBlk.fontData[i])) &&
            (styleMatch (&ctrlBlk, ctrlBlk.fontData[i])) &&
            ((ctrlBlk.showPropFonts == PREF_PROP) || 
             (notPropFont(ctrlBlk.fontData[i]))))
        {
            getSizePart(ctrlBlk.fontData[i], buff1, ctrlBlk.showSizeInPixels);
            addItemToList(itemBuf3, buff1, &itemCount3);
        }
    }   /* end - for (i = 0; i < ctrlBlk.numFonts; i++) */

    /*  recreate all three scroll lists where necessary */
    if (dontChange != FONT)
    {
        for (i = 0; i < itemCount1; i++)
        {
            items[i] = XmStringCreate(itemBuf1[i], XmSTRING_DEFAULT_CHARSET);
            XtFree(itemBuf1[i]);
        }
        XmListDeleteAllItems(ctrlBlk.fontList);
        XmListAddItems(ctrlBlk.fontList, items, itemCount1, 1);
        if (ctrlBlk.sel1 != NULL)
        {
            XmStringFree(items[0]);
            items[0] = XmStringCreate(ctrlBlk.sel1, XmSTRING_DEFAULT_CHARSET);
            XmListSelectItem(ctrlBlk.fontList, items[0], FALSE);
            XmListSetBottomItem(ctrlBlk.fontList, items[0]);
        }
        for (i = 0; i < itemCount1; i++)
            XmStringFree(items[i]);
    }

    if (dontChange != STYLE)
    {
        for (i = 0; i < itemCount2; i++)
        {
            items[i] = XmStringCreate(itemBuf2[i], XmSTRING_DEFAULT_CHARSET);
            XtFree(itemBuf2[i]);
        }
        XmListDeleteAllItems(ctrlBlk.styleList);
        XmListAddItems(ctrlBlk.styleList, items, itemCount2, 1);
        if (ctrlBlk.sel2 != NULL)
        {
            XmStringFree(items[0]);
            items[0] = XmStringCreate(ctrlBlk.sel2, XmSTRING_DEFAULT_CHARSET);
            XmListSelectItem(ctrlBlk.styleList, items[0], FALSE);
            XmListSetBottomItem(ctrlBlk.styleList, items[0]);
        }
        for (i = 0; i < itemCount2; i++)
            XmStringFree(items[i]);
    }

    if (dontChange != SIZE)
    {
        for (i = 0; i < itemCount3; i++)
        {
            items[i] = XmStringCreate(itemBuf3[i],
                              XmSTRING_DEFAULT_CHARSET);
            XtFree(itemBuf3[i]);
        }
        XmListDeleteAllItems(ctrlBlk.sizeList);
        XmListAddItems(ctrlBlk.sizeList, items, itemCount3, 1);
        if (ctrlBlk.sel3 != NULL)
        {
            XmStringFree(items[0]);
            items[0] = XmStringCreate(ctrlBlk.sel3, XmSTRING_DEFAULT_CHARSET);
            XmListSelectItem(ctrlBlk.sizeList, items[0], FALSE);
            XmListSetBottomItem(ctrlBlk.sizeList, items[0]);
        }
        for (i = 0; i < itemCount3; i++)
            XmStringFree(items[i]);
    }
}