問題描述
顯示位圖和處理按鈕按下的簡單框架 (Simple Frameworks for Displaying Bitmaps and Handling Button Presses)
我們有一組應用程序,它們基本上顯示一堆位圖和文本,然後允許用戶按下導致動作發生的“按鈕”(某些位圖)。
我們目前使用這些實現這些DirectX 和一堆用於放置位圖和處理按鈕按下的代碼。但我們希望擁有以下功能:
- 可移植到 Linux
- 某種“編輯器”,允許我們在沒有硬編碼位置的情況下佈置屏幕代碼中的元素數
- 動畫
- 我們需要能夠覆蓋視頻
- 不是資源密集型(這些終端沒有很多內存或CPU )
- 我們目前使用的是 C++,因此管理層更願意這樣做,但會考慮其他語言
- 我們更喜歡免費的開源解決方案,但如果價格不太貴,我們也願意購買。(我們有幾十個開發人員,部署了數以萬計的終端。)
我們不喜歡常見的 GUI 工具包或小部件。我們想要一些更像遊戲而不是對話框的東西。
對我們可以使用的現成的東西有什麼建議嗎?
參考解法
方法 1:
Maybe the way to go is something like Clutter or Allegro. If you check in this article at ArsTechnica what they are using Clutter for, you might get an idea how to use it. I don't know for sure if it works on Windows, but I'm pretty sure it does, considering it only depends on libraries that are supported under Windows.
方法 2:
You could try wxWidgets (it has wxBitmapButton) or try to implement your own solution using SDL for all of the graphics.
方法 3:
"We don't like the common GUI toolkits or widgets. We want something that has more of the look of a game than of a dialog box."
You realize that Trolltech's QT has a style sheet language for widgets? Take a look at their white paper, specifically page 60
http://trolltech.com/pdf/qt43‑whitepaper‑us.pdf
Going over your other requirements:
- portable to Linux
Yes. Also supports Windows, Mac, and embedded environments.
- some sort of "editor" that would allow us to lay out screens without hard‑coding locations of elements in code
Qt's Designer is a very nice tool. I use it all the time.
- animation
Qt supports this.
- we need to be able to overlay video
Qt supports this.
- not resource intensive (these terminals don't have a lot of memory or CPU)
This might be the fly in the ointment. You could check out Qt's embedded option. I've never used that myself.
- we're currently using C++, so management would prefer that, but other languages would be considered
Qt is for C++ and works with all major compilers.
- We'd prefer a free, open‑source solution, but would be willing to buy something if it is not too expensive. (We have a couple dozen developers, and tens of thousands of terminals deployed.)
Qt has both open‑source and closed source options.
(by Kristopher Johnson、dguaraglia、Michał Piaskowski、nsanders)