From: <se...@la...> - 2001-06-16 20:08:24
|
How do you force a textfield selection to be visible within the textfield? I've been reading through the posts on autoscrolling a RichEdit, but that makes it scroll down a given number of lines. I want the textfield to scroll only if the selection is not visible, and then only enough to make the selection visible. (I could change to a RichEdit if this is not possible with a textfield.) |
From: Johan L. <jo...@ba...> - 2001-06-16 20:39:35
|
Sean wrote: >How do you force a textfield selection to be visible within the >textfield? I've been reading through the posts on autoscrolling a >RichEdit, but that makes it scroll down a given number of lines. I >want the textfield to scroll only if the selection is not visible, >and then only enough to make the selection visible. (I could change >to a RichEdit if this is not possible with a textfield.) Don't know about a Textfield, but if you chose to go with a RichEdit, you can use the sub Win32::GUI::AdHoc::richEditScroll, available at: http://www.bahnhof.se/~johanl/perl/Win32GUI/ I guess you still have to keep track of the selection and at what line it is located somehow. Just looked up the Textfield thing BTW: An application sends an EM_LINESCROLL message to scroll the text vertically or horizontally in a multiline edit control. EM_LINESCROLL wParam = (WPARAM) cxScroll; // characters to scroll horizontally lParam = (LPARAM) cyScroll; // lines to scroll vertically /J ------ ---- --- -- -- -- - - - - - Johan Lindström Boss Casinos Sourcerer jo...@ba... http://www.bahnhof.se/~johanl/ If the only tool you have is a hammer, everything tends to look like a nail |
From: Johan L. <jo...@ba...> - 2001-06-17 12:00:47
|
A weird thing: According to the docs, you can attach an -imagelist to a TabStrip, and then specify the image index when you add a Tab. But the sample app for TabStrip attaches an ImageList and specifies _Bitmap_ objects. According to the XS code (just a brief look), it should work like the docs say, and according to the API, the ImageList index is the only way to go. When I try to do the "right" thing (with image indexes), it doesn't work. So... Any working piece of code I could take a glance at? /J ------ ---- --- -- -- -- - - - - - Johan Lindström Boss Casinos Sourcerer jo...@ba... http://www.bahnhof.se/~johanl/ If the only tool you have is a hammer, everything tends to look like a nail |
From: Aldo C. <da...@pe...> - 2001-06-18 08:24:45
|
Johan Lindstrom wrote: > A weird thing: > > According to the docs, you can attach an -imagelist to a TabStrip, and then > specify the image index when you add a Tab. > > But the sample app for TabStrip attaches an ImageList and specifies > _Bitmap_ objects. not quite. the sample (tabstrip.pl in the samples directory from the source distribution) actually uses indexes from the ImageList. my $IL = new GUI::ImageList(16, 16, 8, 3, 10); my $IMG_ONE = $IL->Add("one.bmp"); the ImageList::Add function returns the index of the added image. $W->Tab->InsertItem( -text => "First", -image => $IMG_ONE, ); and here we use that index for the TabStrip. > According to the XS code (just a brief look), it should work like the docs > say, and according to the API, the ImageList index is the only way to go. > > When I try to do the "right" thing (with image indexes), it doesn't work. the problem is probably somewhere else... :-) cheers, Aldo __END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print; |
From: Johan L. <jo...@ba...> - 2001-06-18 09:51:23
|
Aldo wrote: >not quite. the sample (tabstrip.pl in the samples directory from the >source distribution) actually uses indexes from the ImageList. Ah, mea culpa! Sloppy research on my part, sorry about the troll post :) To my excuse I'd like to mention that during the creation of <HYPE>The GUI Loft</HYPE> I have come in contact with details of a lot of controls, and there _are_ a few things that doesn't seem to work quite like they should. So my default reaction to weird things right now is that it's not necessarily 100% my fault ;) But, I'll try things out more thouroughly before I complain in the future :) I'm compiling a list of other possibly broken things that I might have misunderstood, and "undocumented" options so that we can incorporate them into the docs. /J - Win32::GUI spelunker ------ ---- --- -- -- -- - - - - - Johan Lindström Boss Casinos Sourcerer jo...@ba... http://www.bahnhof.se/~johanl/ If the only tool you have is a hammer, everything tends to look like a nail |
From: Johan L. <jo...@ba...> - 2001-06-20 17:20:33
|
Hi! I just released the first beta of The GUI Loft. From the User manual: "The GUI Loft is a powerful and easy-to-use WYSIWYG editor for designing Win32::GUI windows, dialog boxes and toolwindows. It is also a set of classes used to create the window for you at runtime." I think and hope you'll like it :) Reactions so far range from "Huh?" (my mother), "looks simply great!" (Aldo), to "That represents everyhing I don't stand for" (colleague Perl programmer). In his defence, that last statement was uttered before he actually started the program :) Download source and/or binaries here: http://www.bahnhof.se/~johanl/perl/Loft/ The Perl Artistic License applies. I'm very interested in "first impresstions". What is the first thing that bugs you? At which time do you first think "why can't I do that?". What is problematic or unclear when it comes to using the windows and dialogs in your own programs? There is an extensive User Manual in the Help menu, please read it. But try the program first, you are programmers and power-users after all, right? :) Currently supported controls are: Window, DialogBox, ToolbarWindow, Button, Label, TextField, RadioButton, CheckBox, GroupBox, Listbox, RichEdit, ListView, ComboBox, TreeView, TabStrip, Timer, ImageList Cool features include: - Pretty extensive WYSIWYG support + 100% accurate preview - Pretty complete support for Win32::GUI control options--and then some - It's actually easy to use (IMHO :) - Docs and demo code - No-code runtime TabStrip management Future plans include: - All controls supported by Win32::GUI - Integrated Resizer support (at least for the simple case) - Simple Event handlers with Actions, so you don't have to code trivial things. - Possibly integration with external editors (don't want to either reinvent that wheel, nor abandon UltraEdit) Have fun! /J ------ ---- --- -- -- -- - - - - - Johan Lindström Boss Casinos Sourcerer jo...@ba... http://www.bahnhof.se/~johanl/ If the only tool you have is a hammer, everything tends to look like a nail |
From: Johan L. <jo...@ba...> - 2001-06-21 07:05:45
|
I just created a discussion forum for The GUI Loft at Yahoo. http://groups.yahoo.com/group/theguiloft I know, "yet another list to subscribe to", but I think it will be pretty low volume after a while, and probably very useful to you if you think that you might actually use The GUI Loft. I have already got a few very good questions, and I think the future Q&A will help everyone involved a lot. I think you can subscribe from this link: http://groups.yahoo.com/group/theguiloft/join?referer=1 You may have to create a Yahoo account (&%&!#, didn't think of that!) but you can change your subscription to your real e-mail address later. Even if you don't sign up, there is this poll you can participate in: "Which control would you most like to see supported next?" http://groups.yahoo.com/group/theguiloft/surveys?id=10091213 /J ------ ---- --- -- -- -- - - - - - Johan Lindström Boss Casinos Sourcerer jo...@ba... http://www.bahnhof.se/~johanl/ If the only tool you have is a hammer, everything tends to look like a nail |
From: Johan L. <jo...@ba...> - 2001-06-21 07:18:22
|
I wrote: >I think you can subscribe from this link: >http://groups.yahoo.com/group/theguiloft/join?referer=1 > >You may have to create a Yahoo account (&%&!#, didn't think of that!) but >you can change your subscription to your real e-mail address later. Hmmm... Maybe the easiest way is to use this link (copy, paste in browser, replace YOUR_EMAIL with, well, your e-mail address): http://groups.yahoo.com/subscribe/theguiloft?user=YOUR_EMAIL And maybe you don't have to sign up with Yahoo after all... /J ------ ---- --- -- -- -- - - - - - Johan Lindström Boss Casinos Sourcerer jo...@ba... http://www.bahnhof.se/~johanl/ If the only tool you have is a hammer, everything tends to look like a nail |
From: Anthony G. <ag...@em...> - 2001-06-25 14:27:02
|
I'm trying to take a segment of C++ code and port it to perl to work into an existing script. The C code does nothing more than sends a message to a running program(Streets on a Disk) using WM_COPYDATA, and returns data from the same... Below is the Perl code I've tried, followed by the C code. I would appreciate ANY help on this, as I'm not very proficient in C(yet!) and have not yet grasped pack()/unpack() nor Win32::API. FWIW: I'm on Win2k Pro - AS 623 use Win32::GUI; use constant NULL=>0; use constant WM_COPYDATA => 74; my $myCommand="\@CUSTOM_MENU_OK text\n"; my $wparm = pack("I", NULL); my $dwData=pack("L",$myCommand); my $lpCopydatastruct=pack("pLp",$dwData,0,NULL); $st32H=Win32::GUI::FindWindow("StreetsOnADisk",""); ## this seems to give me "The handle is invalid" Win32::GUI::SendMessage($st32H,WM_COPYDATA,$lpCopydatastruct,0); I've also tried API: use Win32::API; use constant NULL=>0; use constant WM_COPYDATA => 74; my $myCommand='@CUSTOM_MENU_OK text'."\n"; my $wparm = pack("I", NULL); my $dwData=pack("L",$myCommand); my $lpCopydatastruct=pack("pLp",$dwData,0,NULL); my $FindWindowEx=new Win32::API('User32','FindWindowEx',[qw(N N P P)],'N'); ## this gives me "The specified procedure could not be found" my $SendMessage=new Win32::API("User32","SendMessage",[qw(N N N N)],'N'); my $hwnd=$FindWindowEx->Call($parent_hwnd,undef,'StreetsOnADisk',undef); my $lresult=$SendMessage->Call($st32H,WM_COPYDATA,$wparm,$lpCopydatastruct); And then the C++ code which works just fine for me: void CAPITestDlg::OnButton1() { CWnd *pWnd = CWnd::FindWindow("StreetsOnADisk", NULL); if (pWnd) { char commands[100]; strcpy(commands,"@CUSTOM_MENU_OK text\n"); COPYDATASTRUCT cds; cds.dwData = 0; //reserved for later use cds.cbData = strlen(commands)+1; /* enter the length of the command string in the buffer+1 */ cds.lpData = (void*) commands; /* point to command buffer */ Sleep(1000); LRESULT result = pWnd->SendMessage(WM_COPYDATA, (WPARAM)AfxGetApp()->m_pMainWnd->GetSafeHwnd(), (LPARAM)&cds); if(result==FALSE) AfxMessageBox("Streets is busy...",MB_OK | MB_ICONSTOP); } else /* on error: */ { AfxMessageBox("Streets On A Disk is not running...",MB_OK | MB_ICONSTOP); } } BOOL CAPITestDlg::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pcds) { if(pcds->dwData == 0) { /* indicates an error processing the commands */ /* show error log: */ AfxMessageBox((char *) pcds->lpData,MB_OK | MB_ICONINFORMATION ); } else /* results were found without errors: */ { /* show results: */ AfxMessageBox((char *) pcds->lpData,MB_OK | MB_ICONINFORMATION ); } return CDialog::OnCopyData(pWnd, pcds); } <sig> Anthony George <ag...@em...> Systems Engineer. Do your technical services need medical attention? We can help. EMSTS, LLC. 800-304-8269 231-720-1600 http://www.emsts.com </sig> |
From: Felix G. <fe...@fr...> - 2001-07-04 20:16:11
|
Hi I have a Win32-GUI application in which a query to a website is executed and the results are displayed afterwards. This can take several seconds. To signal to the user that his query is being processed and he should wait, I would like to display the mouse cursor in the form of an hourglass while the query is processed, and turn it back to the original arrow form afterwards. Who can help me with this? Best Regards, Felix Gaehler |