c++ - 为 Mac OS X 修改旧的 Windows 程序

标签 c++ macos

此应用程序是在 1998 年为 Windows 编写的, 我喜欢使用这个程序,现在我想学习如何制作它 在 Mac 上工作,并且可能更改和添加功能,

问题是我不知道从何入手,我学过C++ php, javascript,但真的不知道如何阅读这段代码。或者从哪里开始。

感谢关注 http://github.com/klanestro/textCalc

来自 http://www.atomixbuttons.com/textcalc/

What is TextCalc?

TextCalc is a combination of an expression calculator and a text editor. Being both, it has several advantages over conventional calculators.

1) You can evaluate expressions like 9*4-2+95-12 just the way you write them on paper.

2) You can put comments besides your answer and expressions.

3) You can save, reload, edit and print your results and expressions.

4) You do not need to write your answer down on a paper before computing another expression, as you can leave the previous result in the editor.

5) You can open an existing text data file and perform calculations on it.

6) You can apply an expression to many numbers at one go. For example, you can change the list 1 2 3 4 5 to 2 4 6 8 10 by multiplying each number by 2.

7) You can sum, average, convert into hex etc. a list of numbers easily.

The editor is capable of parsing numbers and strings enclosed in double quotes " ". Numbers will be colored blue and strings will be colored red. This makes it ideal for editing files containing numeric data.

★✩

最佳答案

根据 TextCalc 网站上的屏幕截图和信息,我认为最好将其实现为 Mac OS X service .您可以在系统偏好设置 -> 键盘 -> 服务中分配一个热键来触发您的服务。

实际上这很容易。您不需要编写文本编辑器部分,它将在所有应用程序的所有文本区域中可用。您将收到用户选择的文本,您需要做的就是对其进行评估。有一个内置的命令行工具,bc ,您应该能够将此委托(delegate)给。

a guide to implementing services .您需要通读 Cocoa intro material了解它。不过,这是一个不错的第一个项目。

我认为在这种情况下没有任何理由尝试阅读原始应用程序的源代码。您只需要知道您想要的行为是什么。

关于c++ - 为 Mac OS X 修改旧的 Windows 程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2108099/

相关文章:

swift - 有没有更快的方法在 MacOS Cocoa swift 应用程序中绘制 NSImage?

macos - 如何ping文件中的每个IP?

c++ - 了解如何创建 atoi;字符是如何比较的?

c++ - CUDA-GDB 在 C/C++ 中查看变量

c++ - 使用自动时 Eigen3 随机矩阵更改值

objective-c - OS X Windows 风格的应用栏

macos - 如何使用 Kqueue 检测文件何时被发送到垃圾箱?

c++ - 从源代码构建咖啡机时遇到问题

C++将函数指针指向的函数分配给另一个函数指针

python - 在 OS X 后台运行 Python