Re: [perl-win32-gui-users] The DateTime control, XS and building win::gui from scratch

2003-10-20 Thread Laurent ROCHER
Hi,

> I need to be able to set and read the minutes and seconds for a date time
> control, but from the XS code it looks like this is not possible (!?).

Yes, Win32::GUI::DateTime by default only work with date.
You can turn it to a time control by adding DTS_TIMEFORMAT (0x0009)
style.

> Could sending messages to the control work? I’ve tried it, but didn’t get
> anywhere fast…

Yes, you can but you need to use a Win32::API because
Win32::GUI::SendMessage handle LPARAM as a numeric value.
See Attached file, for a sample. With last Win32::API, you can use
Win32::API::Struct instead pack/unpack.

> But…I’ve never built win::gui from scratch, nor played with XS. I must
admit
> that I am daunted at the prospect! I am desperate, so am willing to go
> through the learning curve and would be grateful for any pointers to where
I
> should start.

If you want build Win32::GUI from scratch.
You must have Visual C++ 6.
I'm not 100% sure but with ActiveState you need a specific service pack
depending perl version.
- for ActivePerl 5.6 and 5.8 => SP6
- for ActivePerl 5.005   => SP4

I suppose you have VC and perl in your path and all is working ok.

1) Open a dos/cmd sonsole
2) Go to Bin directory of your Visual C++, and run VCVARS32.bat.
3) Go to Win32::GUI directory.
perl MakeFile.pl  <-- make a makefile for build
Win32::GUI
nmake <-- build Win32::GUI
nmake install <-- install Win32::GUI in perl
directory.

If all Work, you can modify GUI.XS and rebuild (nmake) and install
(nmake install).
For learn XS programming, take a look to perlxs documentation.
You have perlxstut for build a xs from scratch.

Call simple function is not very difficult if you have some C knowledge.
You can look to GUI.xs for different code samples

See below for what you can do for set and get date&time information.
(I have not test this code but i think it's ok)

Laurent.


###
# (@)METHOD:GetDateTime()
# (preliminary) Returns the date and time in the DateTime control in a three
# elements array (year, month, day, dayofweek, hour, minute, second,
millisecond).

void
GetDateTime(handle)
 HWND handle
PREINIT:
 SYSTEMTIME st;
PPCODE:
 if(DateTime_GetSystemtime(handle, &st) == GDT_VALID) {
 EXTEND(SP, 8)
 XST_mIV(0, st.wYear);
 XST_mIV(1, st.wMonth);
 XST_mIV(2, st.wDay);
 XST_mIV(3, st.wDayOfWeek);
 XST_mIV(4, st.wHour);
 XST_mIV(5, st.wMinute);
 XST_mIV(6, st.wSecond);
 XST_mIV(7, st.wMilliseconds);
 XSRETURN(8);
 } else {
 XSRETURN_UNDEF;
 }

###
# (@)METHOD:SetDateTime(YEAR,MOn, DAY, HOUR, MIN, SEC, [MSEC=0])
# (preliminary) Sets the date in the DateTime control
BOOL
SetDateTime(handle, year, mon, day, hour, min, sec, msec=0)
 HWND handle
 int year
 int mon
 int day
 int hour
 int min
 int sec
 int msec
PREINIT:
 SYSTEMTIME st;
CODE:
 ZeroMemory(&st, sizeof(SYSTEMTIME));
 st.wYear   = year;
 st.wDay= day;
 st.wMonth  = mon;
 st.wHour   = hour;
 st.wMinute = min;
 st.wSecond = sec;
 st.wMilliseconds = msec;

 RETVAL = DateTime_SetSystemtime(handle, GDT_VALID, &st);
OUTPUT:
  RETVAL
##
<>


Re: [perl-win32-gui-users] scrollbars on a label?

2003-10-20 Thread Laurent ROCHER
Hello,

It's possible to have a scroll bar with a label, but i don't think you
can manage text scrolling.

Easy way, it's to use a multiline TextEdit  with Label look.

my $Multitext = $Window->AddTextfield (
-name  => "Multitext",
-multiline   => 1,
-vscroll  => 1,
-pos  => [  0, 0 ],
-size  => [100, 60 ],
-readonly  => 1,
# ReadOnly
-popstyle  => WS_BORDER,  # Remove
Border
-popexstyle  => WS_EX_CLIENTEDGE , # Remove ClientEdge
);

$Multitext->Text ("line1\r\nline2\r\nline3"); # Set text : \r\n for
new line
$Multitext->Append("\r\nline4"); # Append text

Laurent.

- Original Message - 
From: Tomáš Rendl

Hello,

I have a novice request, so I hope someone will be able to help me. I want
to print out several lines of text on the screen. I would like to use a
label with a scrollbar, so that the user could browse through the printed
text. Is that possible? Or is there some other control suited better to my
needs?

Thanks

Tomas




Re: [perl-win32-gui-users] The DateTime control, XS and building win::gui from scratch

2003-10-20 Thread Laurent ROCHER
Hi,

> I need to be able to set and read the minutes and seconds for a date time
> control, but from the XS code it looks like this is not possible (!?).

Yes, Win32::GUI::DateTime by default only work with date.
You can turn it to a time control by adding DTS_TIMEFORMAT (0x0009)
style.

> Could sending messages to the control work? I’ve tried it, but didn’t get
> anywhere fast…

Yes, you can but you need to use a Win32::API because
Win32::GUI::SendMessage handle LPARAM as a numeric value.
See Attached file, for a sample. With last Win32::API, you can use
Win32::API::Struct instead pack/unpack.

> But…I’ve never built win::gui from scratch, nor played with XS. I must
admit
> that I am daunted at the prospect! I am desperate, so am willing to go
> through the learning curve and would be grateful for any pointers to where
I
> should start.

If you want build Win32::GUI from scratch.
You must have Visual C++ 6.
I'm not 100% sure but with ActiveState you need a specific service pack
depending perl version.
- for ActivePerl 5.6 and 5.8 => SP6
- for ActivePerl 5.005   => SP4

I suppose you have VC and perl in your path and all is working ok.

1) Open a dos/cmd sonsole
2) Go to Bin directory of your Visual C++, and run VCVARS32.bat.
3) Go to Win32::GUI directory.
perl MakeFile.pl  <-- make a makefile for build
Win32::GUI
nmake <-- build Win32::GUI
nmake install <-- install Win32::GUI in perl
directory.

If all Work, you can modify GUI.XS and rebuild (nmake) and install
(nmake install).
For learn XS programming, take a look to perlxs documentation.
You have perlxstut for build a xs from scratch.

Call simple function is not very difficult if you have some C knowlege.
You can look to GUI.xs for different code samples

See below for what you can do for set and get date&time information.
(I have not test this code but i think it's ok)

Laurent.


###
# (@)METHOD:GetDateTime()
# (preliminary) Returns the date and time in the DateTime control in a three
# elements array (year, month, day, dayofweek, hour, minute, second,
millisecond).

void
GetDateTime(handle)
 HWND handle
PREINIT:
 SYSTEMTIME st;
PPCODE:
 if(DateTime_GetSystemtime(handle, &st) == GDT_VALID) {
 EXTEND(SP, 8)
 XST_mIV(0, st.wYear);
 XST_mIV(1, st.wMonth);
 XST_mIV(2, st.wDay);
 XST_mIV(3, st.wDayOfWeek);
 XST_mIV(4, st.wHour);
 XST_mIV(5, st.wMinute);
 XST_mIV(6, st.wSecond);
 XST_mIV(7, st.wMilliseconds);
 XSRETURN(8);
 } else {
 XSRETURN_UNDEF;
 }

###
# (@)METHOD:SetDateTime(YEAR,MOn, DAY, HOUR, MIN, SEC, [MSEC=0])
# (preliminary) Sets the date in the DateTime control
BOOL
SetDateTime(handle, year, mon, day, hour, min, sec, msec=0)
 HWND handle
 int year
 int mon
 int day
 int hour
 int min
 int sec
 int msec
PREINIT:
 SYSTEMTIME st;
CODE:
 ZeroMemory(&st, sizeof(SYSTEMTIME));
 st.wYear   = year;
 st.wDay= day;
 st.wMonth  = mon;
 st.wHour   = hour;
 st.wMinute = min;
 st.wSecond = sec;
 st.wMilliseconds = msec;

 RETVAL = DateTime_SetSystemtime(handle, GDT_VALID, &st);
OUTPUT:
  RETVAL
##
<>


[perl-win32-gui-users] Removing checkboxes

2003-10-20 Thread Joseph . Vieira
Hello,

How do you remove a checkbox from a window.  I want to be able to click a
button and remove all check boxes from the window and all references to
them?

Thanks,
Joe








RE: [perl-win32-gui-users] Removing checkboxes

2003-10-20 Thread Peter Eisengrein
I don't think this will work, but maybe $checkbox->Hide() ?

If not, you could create a blank Label to "cover" it.

-Pete


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Monday, October 20, 2003 1:42 PM
To: perl-win32-gui-users@lists.sourceforge.net
Subject: [perl-win32-gui-users] Removing checkboxes


Hello,

How do you remove a checkbox from a window.  I want to be able to click a
button and remove all check boxes from the window and all references to
them?

Thanks,
Joe







---
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
___
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users