/*
** Astrolog (Version 5.40) File: wdialog.c
**
** IMPORTANT NOTICE: The graphics database and chart display routines
** used in this program are Copyright (C) 1991-1998 by Walter D. Pullen
** (Astara@msn.com, http://www.magitech.com/~cruiser1/astrolog.htm).
** Permission is granted to freely use and distribute these routines
** provided one doesn't sell, restrict, or profit from them in any way.
** Modification is allowed provided these notices remain with any
** altered or edited versions of the program.
**
** The main planetary calculation routines used in this program have
** been Copyrighted and the core of this program is basically a
** conversion to C of the routines created by James Neely as listed in
** Michael Erlewine's 'Manual of Computer Programming for Astrologers',
** available from Matrix Software. The copyright gives us permission to
** use the routines for personal use but not to sell them or profit from
** them in any way.
**
** The PostScript code within the core graphics routines are programmed
** and Copyright (C) 1992-1993 by Brian D. Willoughby
** (brianw@sounds.wa.com). Conditions are identical to those above.
**
** The extended accurate ephemeris databases and formulas are from the
** calculation routines in the program "Placalc" and are programmed and
** Copyright (C) 1989,1991,1993 by Astrodienst AG and Alois Treindl
** (alois@azur.ch). The use of that source code is subject to
** regulations made by Astrodienst Zurich, and the code is not in the
** public domain. This copyright notice must not be changed or removed
** by any user of this program.
**
** Initial programming 8/28,30, 9/10,13,16,20,23, 10/3,6,7, 11/7,10,21/1991.
** X Window graphics initially programmed 10/23-29/1991.
** PostScript graphics initially programmed 11/29-30/1992.
** Last code change made 12/20/1998.
*/
#include "astrolog.h"
#ifdef WIN
/*
******************************************************************************
** Dialog Utility Functions.
******************************************************************************
*/
/* Set the contents of the given edit control in a dialog to a string. */
void SetEditSz(hdlg, id, sz)
HWND hdlg;
int id;
char *sz;
{
while (*sz == ' ') /* Strip off any extra leading spaces. */
sz++;
SetEdit(id, sz);
}
/* Set the contents of the given edit control in a dialog to a floating */
/* point value, with at most 'n' significant fractional digits. */
void SetEditR(hdlg, id, r, n)
HWND hdlg;
int id;
real r;
int n;
{
char sz[cchSzDef], szT[8], *pch;
sprintf(szT, "%%.%df", n);
sprintf(sz, szT, r);
for (pch = sz; *pch; pch++)
;
while (*(--pch) == '0') /* Drop off any trailing zero digits. */
;
pch[1 + (*pch == '.')] = chNull; /* Ensure at least one fractional digit. */
SetEdit(id, sz);
}
/* Set the contents of four combo controls and their dropdowns in a dialog */
/* indicating month, day, year, and time fields to the given values. */
void SetEditMDYT(hdlg, idMon, idDay, idYea, idTim, mon, day, yea, tim)
HWND hdlg;
int idMon, idDay, idYea, idTim;
int mon, day, yea;
real tim;
{
char sz[cchSzDef];
int i;
ClearCombo(idMon);
ClearCombo(idDay);
ClearCombo(idYea);
ClearCombo(idTim);
if (!FValidMon(mon))
mon = 1;
sprintf(sz, "%c%c%c", chMon3(mon));
SetEdit(idMon, sz);
for (i = 1; i <= cSign; i++)
SetCombo(idMon, szMonth[i]);
if (!FValidDay(day, mon, yea))
day = 1;
SetEditN(idDay, day);
SetCombo(idDay, "1"); SetCombo(idDay, "15");
SetEditN(idYea, yea);
for (i = 1990; i < 2000; i++) {
sprintf(sz, "%d", i); SetCombo(idYea, sz);
}
sprintf(sz, "%s", SzTim(tim));
SetEditSz(hdlg, idTim, sz);
SetCombo(idTim, "Midnight");
SetCombo(idTim, (char *)(us.fEuroTime ? "6:00" : "6:00am"));
SetCombo(idTim, "Noon");
SetCombo(idTim, (char *)(us.fEuroTime ? "18:00" : "6:00pm"));
}
/* Set the contents of four combo controls in a dialog indicating daylight, */
/* time zone, longitude, and latitude fields to the given values. */
void SetEditSZOA(hdlg, idDst, idZon, idLon, idLat, dst, zon, lon, lat)
HWND hdlg;
int idDst, idZon, idLon, idLat;
real dst, zon, lon, lat;
{
char sz[cchSzDef];
int i;
bool fT;
if (dst == 0.0 || dst == 1.0)
sprintf(sz, "%s", dst == 0.0 ? "No" : "Yes");
else
sprintf(sz, "%.2f", dst);
SetEdit(idDst, sz);
SetCombo(idDst, "No"); SetCombo(idDst, "Yes");
sprintf(sz, "%s", SzZone(-zon));
SetEdit(idZon, (char *)(sz[0] == '+' ? &sz[1] : sz));
/* For the time zone dropdown, fill it out with all abbreviations of */
/* three letters that don't reference daylight or war time. */
for (i = 0; i < cZone; i++) {
if (szZon[i][1] && szZon[i][1] != 'D' && szZon[i][1] != 'W' &&
szZon[i][2] && szZon[i][2] != 'D')
SetCombo(idZon, szZon[i]);
}
fT = us.fAnsiChar; us.fAnsiChar = fFalse;
sprintf(sz, "%s", SzLocation(lon, lat));
us.fAnsiChar = fT;
sz[7] = chNull;
SetEditSz(hdlg, idLon, &sz[0]);
SetCombo(idLon, "122W20"); SetCombo(idLon, "0E00");
SetEditSz(hdlg, idLat, &sz[8]);
SetCombo(idLat, "47N36"); SetCombo(idLat, "0S00");
}
/* Set the contents of a combo control in a dialog indicating a color */
/* field to the given value, and fill its dropdown with the color list. */
void SetEditColor(hdlg, id, ki)
HWND hdlg;
int id;
KI ki;
{
int i;
SetEdit(id, szColor[ki]);
for (i = 0; i < cColor; i++)
SetCombo(id, szColor[i]);
}
/* Return the contents of a dialog edit control as a floating point value. */
real GetEditR(hdlg, id)
HWND hdlg;
int id;
{
char sz[cchSzDef];
GetEdit(id, sz);
return atof(sz);
}
/* Bring up an error box indicating an illegal value for a dialog field. */
void ErrorEnsure(n, sz)
int n;
char *sz;
{
char szT[cchSzDef];
sprintf(szT, "The value %d is not a valid %s setting.", n, sz);
PrintWarning(szT);
}
/* Take many of the user visible settings, and write them out to a new */
/* command switch file, which may be read in to restore those settings. */
/* Most often this would be used to create a new astrolog.dat default */
/* settings file. This is called from the File Save Settings menu command. */
bool FOutputSettings()
{
char sz[cchSzDef];
FILE *file;
int i;
bool fT;
if (us.fNoWrite)
return fFalse;
file = fopen(is.szFileOut, "w"); /* Create and open the file for output. */
if (file == NULL) {
sprintf(sz, "Settings file %s can not be created.", is.szFileOut);
PrintError(sz);
return fFalse;
}
sprintf(sz, "@0308 ; %s (%s) default settings file %s\n\n",
szAppName, szVersionCore, DEFAULT_INFOFILE); PrintFSz();
sprintf(sz, "-z0 %d ", (int)us.dstDef); PrintFSz();
PrintF("; Default Daylight time setting [0 standard, 1 daylight]\n");
sprintf(sz, "-z %s ", SzZone(-us.zonDef)); PrintFSz();
PrintF("; Default time zone [hours before GMT ]\n");
fT = us.fAnsiChar; us.fAnsiChar = 3;
sprintf(sz, "-zl %s ", SzLocation(us.lonDef, us.latDef)); PrintFSz();
us.fAnsiChar = fT;
PrintF("; Default longitude and latitude\n\n");
sprintf(sz, "-Yz %ld ", us.lTimeAddition); PrintFSz();
PrintF(
"; Time minute addition to be used when \"now\" charts are off.\n-n");
PrintF(
" ; Uncomment this line to start with the chart for \"now\".\n\n");
sprintf(sz, "%cs ", ChDashF(us.fSidereal)); PrintFSz();
PrintF(
"; Zodiac selection [\"_s\" is tropical, \"=s\" is sidereal]\n");
sprintf(sz, ":s %.0f ", us.rZodiacOffset); PrintFSz();
PrintF(
"; Zodiac offset value [Change \"0\" to desired offset ]\n");
sprintf(sz, "-A %d ", us.nAsp); PrintFSz();
PrintF(
"; Number of aspects [Change \"5\" to desi
没有合适的资源?快使用搜索试试~ 我知道了~
星盘算法c语音版
共44个文件
c:23个
ico:4个
h:4个
4星 · 超过85%的资源 需积分: 16 63 下载量 161 浏览量
2012-02-22
16:08:29
上传
评论 1
收藏 291KB ZIP 举报
温馨提示
星盘算法c语音
资源推荐
资源详情
资源评论
收起资源包目录
ast54src.zip (44个子文件)
EXTERN.H 24KB
XGENERAL.C 26KB
GENERAL.C 28KB
ASTROLOG.C 49KB
WDRIVER.C 45KB
RESOURCE.H 25KB
CHARTS2.C 30KB
ASTRLOG2.URL 62B
XSCREEN.C 52KB
ASTROLOG.RC 91KB
ASTROLOG.H 50KB
DATA2.C 16KB
DATA.C 21KB
ASTRLOG3.ICO 766B
MAKEFILE.CFG 1KB
MATRIX.C 22KB
XCHARTS0.C 32KB
PLACALC2.C 36KB
ASTROLOG.DAT 4KB
ASTRLOG2.ICO 766B
CHARTS1.C 49KB
XCHARTS2.C 27KB
ASTROLOG.MAK 5KB
INTRPRET.C 23KB
XDEVICE.C 21KB
MAKEFILE.COM 1KB
XCHARTS1.C 41KB
PLACALC.H 16KB
CHARTS0.C 46KB
IO.C 23KB
MAKEFILE 1KB
PLACALC.C 43KB
XDATA.C 28KB
WDIALOG.C 56KB
ASTROLOG.URL 72B
MAKEFILE.BGI 1KB
ASTROLOG.DEF 2KB
ASTRLOG4.ICO 766B
MAKEFILE.UNX 1KB
CALC.C 30KB
FILE_ID.DIZ 798B
CHARTS3.C 25KB
ASTRLOG1.ICO 766B
README.540 15KB
共 44 条
- 1
资源评论
- sinjimmyi2013-01-09太老了,也没有文档什么的。。
- gdcwj2015-02-18老程序,学习下不错
- a7240081582018-11-26下了看不懂
在路上20130607
- 粉丝: 57
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功