1. Example wanted
- Posted by dcole Oct 16, 2010
- 1407 views
I need an example I can't find in the examples. (win32lib\demo\)
Maybe one is there but I can't find it.
Ones that are close are BkGnd16.exw. this only shows one letter.
fullscreen.exw. no text
drawing2.exw no text
In all cases these examples do what I want.
If the maximize square is clicked the window goes full screen and the picture changes size accordingly.
If the bottom right corner of the window is dragged the window size changes and the picture changes accordingly.
Although in drawing2.exw I see the picture changes in resize. I don't really want the picture to change.
The only difference in the examples and what I need is, all the examples use picture, I want to do it with text.
WPuts({MyWindow,10.10},"Hello World").
Any ideas how to do this.
Don Cole
2. Re: Example wanted
- Posted by DerekParnell (admin) Oct 16, 2010
- 1385 views
I need an example I can't find in the examples. (win32lib\demo\)
...
The only difference in the examples and what I need is, all the examples use picture, I want to do it with text.
WPuts({MyWindow,10.10},"Hello World").
Any ideas how to do this.
How to do what? You haven't actually explained what it is you want to achieve.
3. Re: Example wanted
- Posted by useless Oct 16, 2010
- 1376 views
I need an example I can't find in the examples. (win32lib\demo\)
...
The only difference in the examples and what I need is, all the examples use picture, I want to do it with text.
WPuts({MyWindow,10.10},"Hello World").
Any ideas how to do this.
How to do what? You haven't actually explained what it is you want to achieve.
How to achieve:
WPuts({MyWindow,10.10},"Hello World")
of course.
useless
4. Re: Example wanted
- Posted by mattlewis (admin) Oct 16, 2010
- 1393 views
I need an example I can't find in the examples. (win32lib\demo\)
...
The only difference in the examples and what I need is, all the examples use picture, I want to do it with text.
WPuts({MyWindow,10.10},"Hello World").
Any ideas how to do this.
How to do what? You haven't actually explained what it is you want to achieve.
How to achieve:
WPuts({MyWindow,10.10},"Hello World")
of course.
Is this like asking how to spell FBI?
Matt
5. Re: Example wanted
- Posted by useless Oct 16, 2010
- 1388 views
I need an example I can't find in the examples. (win32lib\demo\)
...
The only difference in the examples and what I need is, all the examples use picture, I want to do it with text.
WPuts({MyWindow,10.10},"Hello World").
Any ideas how to do this.
How to do what? You haven't actually explained what it is you want to achieve.
How to achieve:
WPuts({MyWindow,10.10},"Hello World")
of course.
Is this like asking how to spell FBI?
Matt
Or the phone number for "911". I dunno, it wasn't my topic. Perhaps if dcole specified why whatever didn't work for him?
useless
6. Re: Example wanted
- Posted by bugfinder Oct 16, 2010
- 1392 views
WPuts({MyWindow,10.10},"Hello World").
7. Re: Example wanted
- Posted by bugfinder Oct 16, 2010
- 1366 views
WPuts({MyWindow,10.10},"Hello World").
setPosition(MyWindow, 10, 10) wPuts(MyWindow,sprintf("%s","Hello World"))
8. Re: Example wanted
- Posted by dcole Oct 16, 2010
- 1345 views
How to do what? You haven't actually explained what it is you want to achieve.
O.K. Sorry. What I want to do is put text into a window and have the text change size proportionately to size changes of the window.
Don Cole
9. Re: Example wanted
- Posted by mattlewis (admin) Oct 16, 2010
- 1376 views
What I want to do is put text into a window and have the text change size proportionately to size changes of the window.
How are you putting the text on the window? Is it drawn on? Is it in a label / text box? The generic answer is that you'll have to change the font size when the window size changes.
Matt
10. Re: Example wanted
- Posted by dcole Oct 16, 2010
- 1380 views
How are you putting the text on the window? Is it drawn on? Is it in a label / text box?
I don't know this is what I am asking. I think not a text box. I just want a plain window.
The generic answer is that you'll have to change the font size when the window size changes.
I agree this would have to do with getClientRect() and setFont() also the spacing of left column and top. What's the formula?
Don Cole
11. Re: Example wanted
- Posted by petelomax Oct 17, 2010
- 1365 views
Hi Don,
Taking a step back here, is this what you're after?
Edit: link removed, that version had no text
"Mapping Mode Scaling Demo".. I think this is the same:
http://openeuphoria.org/forum/52645.wc#52645
and of course I have an arwen version of this if you need it.
Edit: you may already have this in the demo folder as Advanc.exw
Regards, Pete
12. Re: Example wanted
- Posted by dcole Oct 17, 2010
- 1317 views
Hi Don,
Taking a step back here, is this what you're after?
Edit: link removed, that version had no text
"Mapping Mode Scaling Demo".. I think this is the same:
http://openeuphoria.org/forum/52645.wc#52645
and of course I have an arwen version of this if you need it.
Edit: you may already have this in the demo folder as Advanc.exw
Regards, Pete
Thank you Pete!,
That's exactly what I was looking for.
It's a matter of balancing onPaint, onResize, and onActivate and the drawing(reDraw text).
I wasen't sure how to set it up. I can build my program around your example.
Thanks again.
Don Cole
13. Re: Example wanted
- Posted by dcole Oct 17, 2010
- 1272 views
Oh Pete,
I forgot to ask could you please post the arwen version of this example.
Don Cole
14. Re: Example wanted
- Posted by petelomax Oct 18, 2010
- 1215 views
Oh Pete,
I forgot to ask could you please post the arwen version of this example.
Don Cole
Here you go
-- Description: -- Similar but not a copy of Chapter 10 - Windows 2000 Graphics API Black Book -- (Coriolis & Damon Chandler), highly recommended for Serious Programmers. -- Keywords: -- Mapping mode, scaling, Viewport, DrawText, setFont -- Credit: translated from Euman's advanc.exw (in demos with win32lib). include arwen.ew -- (..\Win32Demo\Advanc.exw is the win32lib version of this) constant MainWin = create(Window, "Mapping Mode Scaling Demo", 0, NULL, 25, 25, 300, 200, 0), xSetGraphicsMode = define_c_func(gdi32,"SetGraphicsMode",{C_POINTER,C_INT},C_INT), xSetMapMode = define_c_func(gdi32,"SetMapMode",{C_POINTER,C_INT},C_INT), xSetViewportExtEx = define_c_func(gdi32,"SetViewportExtEx",{C_LONG,C_INT,C_INT,C_INT},C_INT), xSetWindowExtEx = define_c_func(gdi32,"SetWindowExtEx",{C_LONG,C_INT,C_INT,C_POINTER},C_INT), xEllipse = define_c_func(gdi32,"Ellipse",{C_POINTER,C_INT,C_INT,C_INT,C_INT},C_LONG), GM_ADVANCED = 2, MM_ANISOTROPIC = 8, MainWinDC = getDC(MainWin), pInitExtent = allocate(16), pText = allocate_string("Euman's Demo on arwen"), DT_CVCS = or_all({DT_CENTER,DT_VCENTER,DT_SINGLELINE}), InitRect = getClientRect(MainWin) constant InitExtent = MainWinDC & InitRect -- for xEllipse constant DrawTextX = {MainWinDC, pText, -1, pInitExtent, DT_CVCS} -- for xDrawText poke4(pInitExtent, InitRect) void = c_func(xSetMapMode,{MainWinDC,MM_ANISOTROPIC}) void = c_func(xSetGraphicsMode,{MainWinDC, GM_ADVANCED}) void = c_func(xSetWindowExtEx,{MainWinDC,InitRect[3],InitRect[4],0}) setFont(MainWin, "Times New Roman", 16, 0) integer Drawing Drawing = 0 function mainHandler(integer id, integer msg, atom wParam, object lParam) sequence CurExtent if id=MainWin then if msg=WM_PAINT then if MainWinDC!=0 and Drawing=0 then Drawing = 1 CurExtent = getClientRect(MainWin) if c_func(xSetViewportExtEx,{MainWinDC,CurExtent[3],CurExtent[4],0}) then -- These don't change, the mapping mode does it! void = c_func(xEllipse,InitExtent) c_proc(xDrawText,DrawTextX) end if Drawing = 0 end if elsif msg=WM_CLOSE then releaseDC(MainWin,MainWinDC) if atom(wParam) or object(lParam) then end if -- (suppress warnings) end if end if return 0 end function setHandler(MainWin, routine_id("mainHandler")) WinMain(MainWin, SW_NORMAL)