craig T.
12-05-2002, 08:30 PM
I want to write a timer program in which dialogue box always stays visable even while I switch from program to program. What commands will I need to keep my little dialoogue box always visable?
|
Click to See Complete Forum and Search --> : Making a dialogue box stay always on top craig T. 12-05-2002, 08:30 PM I want to write a timer program in which dialogue box always stays visable even while I switch from program to program. What commands will I need to keep my little dialoogue box always visable? ktkawabe 12-06-2002, 06:43 AM Hi, short questions before returning to work. Which OS (EPOC or SIBO or newer Symbian OSs) and development language? For which kind of application? Do you want to keep the keyboard focus all the time by your dialog? craig T. 12-06-2002, 11:05 AM This is for a Mako, Epoc release 5. I do not want it to maintain keyboard focus all the time. I just want it to display the count down timer while I am typing a note and switching to a spread sheet etc. I tend to spend too much time documenting my work and I want this to discipline me to be brief. ktkawabe 12-08-2002, 10:15 AM Hi Craig,I do not want it to maintain keyboard focus all the time. I was worrying if you'd say that;) This is not a casual programming. I assume that you want to use OPL, and in that case there's no decent way to do that, I'm afraid. It might be that you can find some third-party OPX to do what is necessary, but otherwise I think you have to write your own OPX using C++ SDK. The closest approximation you can try is: 0. On startup, resize your window by gSetWin and draw whatever you'd like to make it look like a dialog box. 1. Check all of the Window Server events by using GetEvent32A. Since you want to use timer (i.e. callback), GetEvent32 is not suitable. 2. If you're sent to background (ev&(1)=&402), immediately send yourself to foreground again using SetForeground: (in system opx). 3. If you receive key events ( (ev&(1) AND &400) = 0 ), immediately redirect that to the background app. Sending keyevent to other app can be done by existing opx ( SendKeyEventToApp in system opx). But finding the background app is not so easy as far as I know. The easiest way is probably to write your own OPX, in which you do something like this: CCoeEnv* env = ControlEnv(); RWsSession aWsSession = env->WsSession(); TApaTaskList aList(aWsSession); TApaTask aTask = aList.FindByPos(1); aTask.SendKey(yourKeyEvent); Even if all of these work, there are several limitations. The most important one is that your app will get keyboard focus anyway. You cannot prevent it as far as you use OPL. The background apps can receive key events redirected by your app, but the cursor of the background app would become invisible (or look odd at least). The second drawback is that, if you use task list to switch to other app, that is not detected by your getevent32 (there may be some workaround, though). All in all, I think it's far better to write the entire app in C++. Anyway that's not easy but using C++ there's more freedom to do whatever you want. If you're serious to go in this direction, please send me an email. Best regards, Keita craig T. 12-08-2002, 06:17 PM Thank you for your very informative reply. I was hoping for something simple. This is not too bad but it does make more since to write in C++. I started learning C++ but then stopped because I did not like my free Borland command line compiler. I hated trying to track down my mistakes with the command line system. I need to get a good compiler for home programming. I am ready to spend the money now. Do you have any recommendations for a Windows based program that has lots of helpful features and can help me with the learning process? Craig diem 12-09-2002, 03:42 AM According to the readme file that comes with it, the C++ SDK for EPOC is guaranteed to integrate with Microsoft Visual C++ V5 or V6. What I don't know is whether it will work with any other development suite. Keita, what are you using? Is it possible to use the SDK with freeware tools? I'm in the same boat you see, I plan to start writing for EPOC in C++, and don't want to have to buy yet another MS product unless I really have to :D ktkawabe 12-09-2002, 12:26 PM Hi Craig and Diem, In short, buying MS VC++ would help you debugging, and that's really an important feature, but otherwise you don't have to buy anything, and buying anything else wouldn't particulary help your EPOC programming. Please note that there are two target architectures in EPOC, i.e. MARM (the real devices) and WINS (the emulator) in ER5. 1. C++ tools used to build your program for MARM are actually from the GNU toolchain, therefore there's no need to purchase anything like VC in theory. You can use Windows or linux, or even use your netBook (if you have one) to build C++ program thanks to epocemx. This stage of development is command-line only, and you have to live with that, but that's not the hardest part. In MARM, you miss a debugger. There's none, really. 2. The usefulness of another target, WINS, is in debugging. You can use the same code for MARM to build for WINS, and debug your code on the emulator. You can use MS VC++'s integrated debugger to set break points to your code, look into the variables, run the code line by line, trace a call stack etc. This makes a huge difference. There are some situations where the real devices and the emulator behave differently, nevertheless it's true that WINS made my life much easier. Unfortunately, you can only use MS VC++ to debug. Answering to your questions, diem, I use VC++ 6.0 Professional (not so happily), but you don't have to. If you need to use some debugger for WINS, MS VC++ is the answer. And Craig,Do you have any recommendations for a Windows based program that has lots of helpful features and can help me with the learning process? This is a tough question ;), as developing for EPOC is quite different from developing for Windows, and neither VC++ nor any other Windows based tool is particulary helpful to learn EPOC programming in my opinion. I use MS VC++ simply because that is the only one to allow me to debug on WINS. Anyway, to learn EPOC programming, a good starting point is "Professional Symbian Programming" (Wrox press). http://www.symbian.com/books/psp/psp-info.html Regards, Keita craig T. 12-09-2002, 04:19 PM VC++ it is. The debugging is the big issue for me. Thanks for the tips and I am on my way. Craig. PDA Street
Copyright Internet.com Inc. All Rights Reserved. |