unsigned long PictureBoxPictureImageScaleYProcedure(HWND Window,HMSG Message,long Param1,long Param2) { switch (Message) { case WINDOWINIT: { char MidString[20]; //gcvt(TmpImageBox.ImageScaleY,5,MidString); sprintf(MidString,"%.2f", TmpImageBox.ImageScaleY); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); break; } case DIALOGBOXOK: { long MidBuffer; char *MidString; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); MidString=(char *)LONG2FP(MidBuffer); if (IsInvalidDigit(MidString)) { MessageBox(GetTitleString(ERRORINFORM), GetInformString(INVALIDBOXTEXTBOTTOMDISTANT),1, WindowGetFather(Window)); return(FALSE); } TmpImageBox.ImageScaleY=atof(MidString); break; } default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
unsigned long ImageShadowProcedure(HWND Window,HMSG Message,long Param1,long Param2) { switch (Message) { case WINDOWINIT: { char MidString[20]; int AttributePosition; gcvt(TmpAttribute4,6,MidString); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); break; } case DIALOGBOXOK: { long MidBuffer; char *MidString; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); MidString=LONG2FP(MidBuffer); TmpAttribute4=atof(MidString); if (TmpAttribute4<0||TmpAttribute4>=MAXCHARCOLOR) { MessageBox(GetTitleString(ERRORINFORM), GetInformString(INVALIDCHARCOLOR),1, WindowGetFather(Window)); return(FALSE); } break; } default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
unsigned long BoxRoundBottomDistantProcedure(HWND Window,HMSG Message,long Param1,long Param2) { switch (Message) { case WINDOWINIT: { char MidString[20]; gcvt(ConvertToSystemMeter((float)TmpTextBox.RoundDistantBottom/(float)(SCALEMETER)), 5,MidString); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); break; } case DIALOGBOXOK: { long MidBuffer; char *MidString; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); MidString=(char *)LONG2FP(MidBuffer); if (IsInvalidDigit(MidString)) { MessageBox(GetTitleString(ERRORINFORM), GetInformString(INVALIDBOXROUNDBOTTOMDISTANT),1, WindowGetFather(Window)); return(FALSE); } TmpTextBox.RoundDistantBottom=ConvertToUserMeter((float)SCALEMETER*atof(MidString))+0.5; break; } default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
char *NSF::GetPlaylistString (const char *format, bool b) { static char buf[NSF_MAX_PATH + 128]; char *p = buf; char *t = GetTitleString (format); p += sprintf (p, "%s::NSF,$%02x,", filename, song + 1); while (*t != '\0') { if (*t == '\\' || *t == ',') *(p++) = '\\'; *(p++) = *(t++); } if (b) { if (time_in_ms >= 0) p += sprintf (p, ",%s", print_time (time_in_ms)); else p += sprintf (p, ","); if (loop_in_ms >= 0) p += sprintf (p, ",%s", print_time (loop_in_ms)); else p += sprintf (p, ","); if (fade_in_ms >= 0) p += sprintf (p, ",%s", print_time (fade_in_ms)); } (*p) = '\0'; return buf; }
unsigned long CharHSizeProcedure(HWND Window,HMSG Message,long Param1,long Param2) { switch (Message) { case WINDOWINIT: { char MidString[20]; int AttributePosition; if(tmp_charsize_option) // Width==Height break; TmpAttribute2=TextSearchAttribute(GlobalBoxHeadHandle, GlobalTextBlockStart,CHARHSIZE,&AttributePosition); //TmpAttribute2=UncompressCHARSIZE(TmpAttribute2); //By zjh 10.29 gcvt(ConvertToSystemMeter(TmpAttribute2/SCALEMETER),6,MidString); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); break; } case DIALOGBOXOK: { long MidBuffer; char *MidString; int w,h; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); MidString=LONG2FP(MidBuffer); TmpAttribute2=ConvertToUserMeter(atof(MidString)*SCALEMETER); MaxRL(GlobalBoxHeadHandle,&w,&h); //By zjh 10.29 //if (TmpAttribute2<MINCHARHSIZE||TmpAttribute2>=MAXCHARHSIZE) //By zjh 10.29 if (TmpAttribute2<MINCHARHSIZE||TmpAttribute2>=MAXCHARHSIZE||TmpAttribute2>=h) { MessageBox(GetTitleString(ERRORINFORM), GetInformString(INVALIDCHARHSIZE),1, Window); return(FALSE); } //TmpAttribute2=CompressCHARSIZE(TmpAttribute2); //By zjh 10.29 break; } case GETFOCUS: case MOUSEMOVE: if(tmp_charsize_option) // Width==Height return(FALSE); default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
unsigned long UpDownProcedure(HWND Window,HMSG Message,long Param1,long Param2) { long MidBuffer; char MidString[20]; // int Position; switch (Message) { case WINDOWINIT: case KEYDOWN: case KEYSTRING: if(Message==WINDOWINIT) { sprintf(MidString,"0.0"); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); } else SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2); break; case DIALOGBOXOK: { char *str; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); str=LONG2FP(MidBuffer); if (atof(str)>7.9f||atof(str)<-7.90f) { MessageBox(GetTitleString(ERRORINFORM), //GetInformString(INVALIDCHARSIZE), "升降必须大于-7.9且小于7.9 !", 1, Window); return(FALSE); } TmpAttribute=atof(str)*10; break; } default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
unsigned long TextDistantTopProcedure(HWND Window,HMSG Message,long Param1,long Param2) { long MidBuffer; char MidString[20]; switch (Message) { case WINDOWINIT: case KEYDOWN: case KEYSTRING: if(Message==WINDOWINIT) { sprintf(MidString,"%.3f",TmpFormBox.TextDistantTop*25.4/SCALEMETER); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); } else SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2); break; case DIALOGBOXOK: { char *str; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); str=LONG2FP(MidBuffer); if (atof(str)>4.0f||atof(str)<0.0f) { MessageBox(GetTitleString(ERRORINFORM), //GetInformString(INVALIDCHARSIZE), " 边距必须大于0.0且小于4.0 !", 1, Window); return(FALSE); } TmpFormBox.TextDistantTop=atof(str)*SCALEMETER/25.4; break; } default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
unsigned long PrintTopBottomProcedure(HWND Window,HMSG Message,long Param1,long Param2) { long MidBuffer; char MidString[20]; switch (Message) { case WINDOWINIT: case KEYDOWN: case KEYSTRING: if(Message==WINDOWINIT) { sprintf(MidString,"%.3f",PYScale); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); } else SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2); break; case DIALOGBOXOK: { char *str; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); str=LONG2FP(MidBuffer); if (atof(str)>10.0f||atof(str)<0.05f) { MessageBox(GetTitleString(ERRORINFORM), //GetInformString(INVALIDCHARSIZE), " 放缩比例必须大于0.05且小于10.0 !", 1, Window); return(FALSE); } PYScale=atof(str); break; } default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
unsigned long BoxBoxTopProcedure(HWND Window,HMSG Message,long Param1,long Param2) { switch (Message) { case WINDOWINIT: { char MidString[20]; //gcvt(ConvertToSystemMeter((float)TmpTextBox.BoxTop/(float)(SCALEMETER)), // 5,MidString); sprintf(MidString,"%.1f", ConvertToSystemMeter((float)TmpTextBox.BoxTop/SCALEMETER) ); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); break; } case DIALOGBOXOK: { long MidBuffer; char *MidString; float tmp; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); MidString=(char *)LONG2FP(MidBuffer); MidString=(char *)LONG2FP(MidBuffer); if (IsInvalidDigit(MidString)) { MessageBox(GetTitleString(ERRORINFORM), GetInformString(INVALIDBOXTOP),1, WindowGetFather(Window)); return(FALSE); } tmp=ConvertToUserMeter((float)SCALEMETER*atof(MidString)); if(tmp>0) tmp+=0.5; else tmp-=0.5; TmpTextBox.BoxTop=tmp; break; } default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
unsigned long CharSlantProcedure(HWND Window,HMSG Message,long Param1,long Param2) { switch (Message) { case WINDOWINIT: { char MidString[20]; int AttributePosition; TmpAttribute=TextSearchAttribute(GlobalBoxHeadHandle, GlobalTextBlockStart,CHARSLANT,&AttributePosition); if (TmpAttribute>MAXCHARSLANTANGLE) TmpAttribute-=360; gcvt(TmpAttribute,6,MidString); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); break; } case DIALOGBOXOK: { long MidBuffer; char *MidString; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); MidString=LONG2FP(MidBuffer); TmpAttribute=atof(MidString); if (TmpAttribute<MINCHARSLANTANGLE||TmpAttribute>=MAXCHARSLANTANGLE) { MessageBox(GetTitleString(ERRORINFORM), GetInformString(INVALIDCHARSLANTANGLE),1, WindowGetFather(Window)); return(FALSE); } if (TmpAttribute<0) TmpAttribute+=360; break; } default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
unsigned long BoxColumnDistantProcedure(HWND Window,HMSG Message,long Param1,long Param2) { switch (Message) { case WINDOWINIT: { char MidString[20]; //gcvt(ConvertToSystemMeter((float)TmpTextBox.ColumnDistant/(float)(SCALEMETER)),5,MidString); sprintf(MidString,"%.1f", ConvertToSystemMeter((float)TmpTextBox.ColumnDistant/SCALEMETER) ); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); break; } case DIALOGBOXOK: { long MidBuffer; char *MidString; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); MidString=(char *)LONG2FP(MidBuffer); if (IsInvalidDigit(MidString)) { lbl_err: MessageBox(GetTitleString(ERRORINFORM), GetInformString(INVALIDCOLUMNDISTANT),1, WindowGetFather(Window)); return(FALSE); } TmpTextBox.ColumnDistant=atof(MidString); if(TmpTextBox.ColumnDistant<0 || TmpTextBox.ColumnDistant>100) goto lbl_err; TmpTextBox.ColumnDistant=ConvertToUserMeter((float)SCALEMETER*atof(MidString))+0.5; break; } default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
unsigned long PageMarginRightProcedure(HWND Window,HMSG Message,long Param1,long Param2) { switch (Message) { case WINDOWINIT: { char MidString[20]; //TmpPage.MarginRight=DEFAULTPAGEHDISTANT; gcvt(TmpPage.MarginRight,6,MidString); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); break; } case DIALOGBOXOK: { long MidBuffer; char *MidString; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); MidString=(char *)LONG2FP(MidBuffer); if (IsInvalidDigit(MidString)) { lbl_err: MessageBox(GetTitleString(ERRORINFORM), GetInformString(INVALIDPAGEMARGINRIGHT),1,1); return(FALSE); } TmpPage.MarginRight=ConvertToUserMeter(atof(MidString))*SCALEMETER; if( TmpPage.MarginRight<0) { goto lbl_err; } break; } default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
unsigned long PageColumnProcedure(HWND Window,HMSG Message,long Param1,long Param2) { switch (Message) { case WINDOWINIT: { char MidString[20]; TmpPage.PageColumn=1; itoa(TmpPage.PageColumn,MidString,10); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); break; } case DIALOGBOXOK: { long MidBuffer; char *MidString; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); MidString=(char *)LONG2FP(MidBuffer); if (IsInvalidDigit(MidString)) { lbl_err: MessageBox(GetTitleString(ERRORINFORM), GetInformString(INVALIDCOLUMN),1,1); return(FALSE); } TmpPage.PageColumn=atoi(MidString); if( TmpPage.PageColumn<=0 || TmpPage.PageColumn>10) { goto lbl_err; } break; } default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
unsigned long PictureBoxPictureRotateAngleProcedure(HWND Window,HMSG Message,long Param1,long Param2) { switch (Message) { case WINDOWINIT: { char MidString[20]; itoa(TmpImageBox.ImageRotateAngle,MidString,10); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); break; } case DIALOGBOXOK: { long MidBuffer; char *MidString; int tmp; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); MidString=(char *)LONG2FP(MidBuffer); if (IsInvalidDigit(MidString)) { MessageBox(GetTitleString(ERRORINFORM), GetInformString(INVALIDROTATEANGLE),1, WindowGetFather(Window)); return(FALSE); } tmp=atoi(MidString); while(tmp>=360) tmp-=360; while(tmp<0) tmp+=360; TmpImageBox.ImageRotateAngle=tmp; break; } default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
unsigned long PageHeightProcedure(HWND Window,HMSG Message,long Param1,long Param2) { switch (Message) { case WINDOWINIT: { char MidString[20]; gcvt(TmpPage.PageHeight,6,MidString); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); break; } case DIALOGBOXOK: { long MidBuffer; char *MidString; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); MidString=(char *)LONG2FP(MidBuffer); if( (TmpPage.PageHeight=atof(MidString)*10)<100 ) // || TmpPage.PageHeight>MAXPAGEHEIGHT) { MessageBox(GetTitleString(ERRORINFORM), GetInformString(INVALIDPAGEHEIGHT),1,1); return(FALSE); } TmpPage.PageHeight=ConvertToUserMeter((float)TmpPage.PageHeight/10)*SCALEMETER; break; } case GETFOCUS: case MOUSEMOVE: if(tmp_pagesize<MaxPaperPara) return(FALSE); default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
unsigned long CharColorProcedure(HWND Window,HMSG Message,long Param1,long Param2) { switch (Message) { case WINDOWINIT: { char MidString[20]; int AttributePosition; TmpAttribute3=TextSearchAttribute(GlobalBoxHeadHandle, GlobalTextBlockStart,CHARCOLOR,&AttributePosition)&0xf; gcvt(TmpAttribute3,6,MidString); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); break; } case DIALOGBOXOK: { long MidBuffer; char *MidString; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); MidString=LONG2FP(MidBuffer); TmpAttribute3=atof(MidString); if (TmpAttribute3<0||TmpAttribute3>=MAXCHARCOLOR) { MessageBox(GetTitleString(ERRORINFORM), GetInformString(INVALIDCHARCOLOR),1, Window); return(FALSE); } break; } default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
unsigned long TableColumnProcedure(HWND Window,HMSG Message,long Param1,long Param2) { switch (Message) { case WINDOWINIT: { char MidString[20]; TmpFormBox.numCols=1; //gcvt(TmpFormBox.numCols,4,MidString); itoa(TmpFormBox.numCols,MidString,10); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); break; } case DIALOGBOXOK: { long MidBuffer; char *MidString; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); MidString=LONG2FP(MidBuffer); TmpFormBox.numCols=atoi(MidString); if (TmpFormBox.numCols<=0||TmpFormBox.numCols>=MAXCLOUMNNUMBER) { MessageBox(GetTitleString(ERRORINFORM), TableLineColNumErrStr, 1,Window); return(FALSE); } break; } default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
unsigned long BoxHeightProcedure(HWND Window,HMSG Message,long Param1,long Param2) { switch (Message) { case WINDOWINIT: { char MidString[20]; //gcvt(ConvertToSystemMeter((float)TmpTextBox.BoxHeight/(float)(SCALEMETER)),5,MidString); sprintf(MidString,"%.1f", ConvertToSystemMeter((float)TmpTextBox.BoxHeight/SCALEMETER) ); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); break; } case DIALOGBOXOK: { long MidBuffer; char *MidString; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); MidString=(char *)LONG2FP(MidBuffer); TmpTextBox.BoxHeight=ConvertToUserMeter((float)SCALEMETER*atof(MidString))+0.5; if (TmpTextBox.BoxHeight<=0) { MessageBox(GetTitleString(ERRORINFORM), GetInformString(INVALIDBOXHEIGHT),1, WindowGetFather(Window)); return(FALSE); } break; } default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
unsigned long CharEFontProcedure(HWND Window,HMSG Message,long Param1,long Param2) { HWND MidWin; switch (Message) { case WINDOWINIT: { char MidString[20]; int AttributePosition; TmpAttribute2=TextSearchEFont(GlobalBoxHeadHandle, GlobalTextBlockStart,&AttributePosition); TmpAttribute2-=1024; if(TmpAttribute2!=tmp_efont_option) // ByHance, 96,4.5 { MidWin=WindowGetFather(Window); // frame window MidWin=WindowGetChild(MidWin); while(MidWin) { if( WindowGetProcedure(MidWin)!=EFontOptionProcedure ) goto lbl_try_next; if(TmpAttribute2<4) { if(RadioGetOrder(Window)==TmpAttribute2) { MessageGo(MidWin,SETSTATUS,1l,0l); break; } } else { if(RadioGetOrder(Window)==tmp_efont_option) { MessageGo(MidWin,SETSTATUS,0l,0l); break; } } lbl_try_next: MidWin=WindowGetNext(MidWin); } /*- while -*/ tmp_efont_option=TmpAttribute2; } TmpAttribute2++; //gcvt(TmpAttribute2,6,MidString); itoa(TmpAttribute2,MidString,10); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); break; } case DIALOGBOXOK: { long MidBuffer; char *MidString; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); MidString=(char *)LONG2FP(MidBuffer); TmpAttribute2=atoi(MidString); if (TmpAttribute2<=0||TmpAttribute2>=MAXFONTNUMBER) { MessageBox(GetTitleString(ERRORINFORM), GetInformString(INVALIDCHARFONT),1, Window); return(FALSE); } --TmpAttribute2; TmpAttribute2+=1024; break; } default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }
unsigned long CharSizeProcedure(HWND Window,HMSG Message,long Param1,long Param2) { long MidBuffer; char MidString[20]; int Position; switch (Message) { case WINDOWINIT: case KEYDOWN: case KEYSTRING: if(Message==WINDOWINIT) { TmpAttribute=TextSearchAttribute(GlobalBoxHeadHandle, GlobalTextBlockStart,CHARSIZE,&Position); //TmpAttribute=UncompressCHARSIZE(TmpAttribute); //By zjh 10.29 //gcvt(ConvertToSystemMeter(TmpAttribute/SCALEMETER),6,MidString); sprintf(MidString,"%.2f",ConvertToSystemMeter(TmpAttribute/SCALEMETER)); MessageGo(Window,SETLINEBUFFER,FP2LONG(MidString),0l); } else SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2); if(tmp_charsize_option) // Width==Height { HWND MidWin; TmpAttribute2=TmpAttribute; MidWin=WindowGetFather(Window); MidWin=WindowGetChild(MidWin); while(MidWin) { if(WindowGetProcedure(MidWin)==CharHSizeProcedure) break; MidWin=WindowGetNext(MidWin); } if(MidWin) { extern short CursorPosX; Position=CursorPosX; // setlinebuffer will change it, so save it MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); MessageGo(MidWin,SETLINEBUFFER,MidBuffer,0l); CursorPosX=Position; if(Message!=WINDOWINIT) MessageGo(MidWin,WMPAINT,0l,GetEditorWidth(WindowGetUserData(MidWin))); } } break; case DIALOGBOXOK: { char *str; int w,h; MidBuffer=MessageGo(Window,GETLINEBUFFER,0l,0l); str=LONG2FP(MidBuffer); TmpAttribute=ConvertToUserMeter(atof(str))*SCALEMETER; MaxRL(GlobalBoxHeadHandle,&w,&h); //By zjh 10.29 //if (TmpAttribute<MINCHARSIZE||TmpAttribute>=MAXCHARSIZE) //By zjh 10.29 if (TmpAttribute<MINCHARSIZE||TmpAttribute>=MAXCHARSIZE||TmpAttribute>=w) { MessageBox(GetTitleString(ERRORINFORM), GetInformString(INVALIDCHARSIZE),1, Window); return(FALSE); } //TmpAttribute=CompressCHARSIZE(TmpAttribute); //By zjh 10.29 break; } default: return(SingleLineEditorDefaultProcedure(Window,Message,Param1,Param2)); } return(TRUE); }