Esempio n. 1
0
void	saveFlashDataFile(object wind, char *name)
{
	char fname[512];
	object	ctllist = gGetControls(wind);
	object	seq, ctl, cls;
	FILE	*fp;

	sprintf(fname,"%s_d.as",name);
	setDialogName(name);

	if (!access(fname,0)) {
		if (IDYES!=gQuery(wind,"WARNING",
				"The data binding file already exists.\nDo you want to overwrite it?",MB_YESNO))
			return;
	}

	fp = fopen(fname, "wt");
	
	if (!fp)
		return;

	if (ctllist)
		for (seq = gSequence(ctllist) ; ctl = gNext(seq) ; ) {
			char *name=gName(ctl);

			if (!strcmp("STATIC",name) || !strcmp("LINE",name) || !strcmp("RECT",name))
				continue;

			cls = ClassOf(ctl);
			if (cls == ComboBox || cls == ListBox )
			{
				char *choicepath=gChoiceXPathBinding(ctl);
				char *mainkeypath=gXPathBinding(ctl);
				char *listkeypath=stripChoicePathOut(choicepath,gListKeyXPathBinding(ctl));
				char *datapath=stripChoicePathOut(choicepath,gDataXPathBinding(ctl));
				char *textpath=stripChoicePathOut(choicepath,gTextXPathBinding(ctl));


				fprintf(fp, "ctl = dlg%s.getControl(\"%s\");\n",dialogName,name);


				fprintf(fp, "ctl.mainkeypath = \"%s\";\n",mainkeypath);
				fprintf(fp, "ctl.choicepath = \"%s\";\n",choicepath);
				fprintf(fp, "ctl.listkeypath = \"%s\";\n",listkeypath);
				fprintf(fp, "ctl.datapath = \"%s\";\n",datapath);
				fprintf(fp, "ctl.textpath = \"%s\";\n",textpath);


				free(listkeypath);
				free(datapath);
				free(textpath);
			}
			else
				fprintf(fp, "dlg%s.bind(\"%s\", \"%s\");\n",dialogName,name,gXPathBinding(ctl));
		}

	fclose(fp);
}
Esempio n. 2
0
imeth int UnsignedShortInteger_im_gCompare(object self, object obj)
{ UnsignedShortInteger_iv_t *iv = GetIVs(UnsignedShortInteger, self);
	unsigned short sv, ov; 

	ChkArg(obj, 2); 
	if (ClassOf(obj) != CLASS) 
		return oSuper(UnsignedShortInteger_c, gCompare, self)(self, obj); 
	if ((sv=iv->iVal) < (ov=ivPtr(obj)->iVal)) 
		return -1; 
	else if (sv == ov) 
		return 0; 
	else 
		return 1; 
} 
Esempio n. 3
0
void	saveFlashFile(object wind, char *fname, char *name)
{
	FILE	*fp = fopen(fname, "wt");
	object	ctllist = gGetControls(wind);
	object	seq, ctl, cls;

	if (!fp)
		return;

	setDialogName(name);

	fprintf(fp, "\nimport com.integra.system.*;\n\n");
	fprintf(fp, "import com.integra.services.Service;\n");
	fprintf(fp, "import com.integra.services.ServiceResponse;\n\n");
	fprintf(fp, "\nvar  ScalingFactor = %f;\n\n",SCALE_FACTOR);
	fprintf(fp, "var  dlg%s:Dialog = new Dialog();\n",dialogName);
	fprintf(fp, "var  ctl:Object;\n\n");
	if (ctllist)
		for (seq = gSequence(ctllist) ; ctl = gNext(seq) ; ) {
			cls = ClassOf(ctl);
			if (cls == StaticTextControl)
				staticTextControl(fp, ctl);
			else if (cls == TextControl)
				textControl(fp, ctl);
			else if (cls == NumericControl)
				numericControl(fp, ctl);
			else if (cls == DateControl)
				dateControl(fp, ctl);
			else if (cls == PushButton)
				pushButtonControl(fp, ctl);
			else if (cls == RadioButton)
				radioButtonControl(fp, ctl);
			else if (cls == CheckBox)
				checkboxControl(fp, ctl);
			else if (cls == ListBox)
				listboxControl(fp, ctl);
			else if (cls == ComboBox)
				comboboxControl(fp, ctl);
			else if (cls == RectControl)
				rectControl(fp, ctl);
			else if (cls == LineControl)
				lineControl(fp, ctl);
		}
	fprintf(fp, "\n#include \"%s_d.as\"\n", name);
	fprintf(fp, "\n#include \"%s.as\"\n", name);
	fclose(fp);
}
Esempio n. 4
0
	void DebugObject (JNIEnv *inEnv, const char *inMessage, jobject inObject) {
		
		if (inObject == 0) {
			
			ELOG ("%s : null", inMessage);
			
		} else {
			
			jclass cls = inEnv->GetObjectClass (inObject);
			jmethodID mid = inEnv->GetMethodID (cls, "toString", "()V");
			jthrowable exc = inEnv->ExceptionOccurred ();
			
			if (exc) {
				
				inEnv->ExceptionClear ();
				
			}
			
			CheckException (inEnv, false);
			
			if (mid) {
				
				jstring str = (jstring)inEnv->CallObjectMethod (cls, mid);
				
				jboolean is_copy;
				const char *utf8 = inEnv->GetStringUTFChars (str, &is_copy);
				ELOG ("%s : '%s'", inMessage, utf8);
				inEnv->ReleaseStringUTFChars (str, utf8);
				inEnv->DeleteLocalRef (str);
				
			} else {
				
				ELOG ("%s : no toString in class '%s'", inMessage, ClassOf (inEnv, inObject).c_str ());
				
			}
			
		}
		
	}