用于创建报告的 Cocoa IB Elements
我正在开发一个应用程序来显示活动和活动中的圈数。我对 Cocoa 相当陌生,但已经创建了一个基本界面来显示“活动”数组的内容,然后响应一个按钮来显示所有选定活动的圈数和一些摘要数据。以下是类结构:
活动类:
- activityDate
- sport
- laps[]
Lap Class:
- startTime
- 总
- 时间 距离
- 最大速度
- 平均速度
- 最大步数
- 平均步数
- 卡路里
- 平均心跳
- 最大心跳
- 强度
我真正想做的是显示一个报告视图,其中显示每个选定的活动及其圈数详细信息和摘要底部有一个大摘要,我可以打印出来。
Running Oct-22-2011 10:10:14 AM
Lap 1 10:10:14 AM 3.80 mi 42:48 11:16/mi ...
Summary 3.80 mi 42:48 11:16/mi ...
Running Oct-24-2011 04:07:06 PM
Lap 1 04:07:06 PM 3.10 mi 31:19 10:06/mi ...
Lap 2 04:38:31 PM 3.10 mi 31:16 10:05/mi ...
Summary 6.20 mi 1:02:36 10:05/mi ....
Grand Summary 10.0 mi 1:45:25 10:29/mi ...
摘要为总计和平均值,具体取决于值。我想要列标题和可能的行突出显示摘要。
我考虑过使用 NSOutlineView 的可能性,因为我希望所有内容都能在列中很好地对齐,但不知道如何使用两个不同的类进行显示。我曾经尝试使用 HTML 创建 NSTextView 来执行此操作,结果还不错。但是,我真的不想生成 HTML 来解决这个问题。
有什么想法和可能的例子吗?
I'm developing an app to display Activities and the Laps within the Activities. I'm fairly new to Cocoa, but have created a basic interface to display the contents of the Activities array and then respond to a button to display the Laps and some summary data for all the selected Activities. Here are the class structures:
Activity Class:
- activityDate
- sport
- laps[]
Lap Class:
- startTime
- totalTime
- distance
- maximumSpeed
- averageSpeed
- maximumPace
- averagePace
- calories
- averageHeartbeat
- maximumHeartbeat
- intensity
What I really want to do is display a report view that shows each selected Activity with its Lap details and summary and a grand summary at the bottom, which I can print.
Running Oct-22-2011 10:10:14 AM
Lap 1 10:10:14 AM 3.80 mi 42:48 11:16/mi ...
Summary 3.80 mi 42:48 11:16/mi ...
Running Oct-24-2011 04:07:06 PM
Lap 1 04:07:06 PM 3.10 mi 31:19 10:06/mi ...
Lap 2 04:38:31 PM 3.10 mi 31:16 10:05/mi ...
Summary 6.20 mi 1:02:36 10:05/mi ....
Grand Summary 10.0 mi 1:45:25 10:29/mi ...
The summaries are totals and averages depending on the value. I want column headings and possible row highlighting for the summaries.
I've looked at possibly using an NSOutlineView, as I want everything to be nicely aligned in columns, but don't know how to use two different classes for the display. I tried once to do this using HTML to create a NSTextView, with okay results. However, I really don't want to generate HTML to solve this.
Any ideas and possible examples?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过研究,我找不到在IB中实现我想要的接口的方法。我重新使用 WebView 和 HTML 来生成报告结果。使用表格和 CSS,我能够创建一组看起来相当令人愉快的报告,并且可以轻松打印。
这是生成的 HTML,因为我无法发布图像(我对 stackoverflow 还太陌生)。
After research, I could not find a way to implement the interface I wanted in IB. I went back to using a WebView and HTML to generate the report results. Using tables and CSS, I was able to create a rather pleasant looking set of reports that can print easily.
Here is the HTML generated, as I cannot post an image (I'm too new to stackoverflow).