English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 05 October 2018, 09:26   #1
thyslo
Registered User
 
Join Date: Apr 2018
Location: Germany
Posts: 189
Beginner questions: text display in an Intuition window and scrolling

Hi everyone,

As a beginner in Amiga C programming I set me the task to read a text file line by line and display it inside an Intuition window (v37/2.04). This is working so far. For window opening I used the following struct TagItem (excerpt)

Code:
struct TagItem windowTags[] =
{
  …
  { WA_IDCMP, IDCMP_MENUPICK | IDCMP_VANILLAKEY | IDCMP_RAWKEY},
  { WA_NewLookMenus, TRUE },  // Ignored before v39
  { WA_Flags, WFLG_GIMMEZEROZERO },
  { WA_SmartRefresh, TRUE },
  { TAG_DONE, NULL },
};
The text display is done with intuition.library / PrintIText().

Then I implemented a basic scrolling for the cursor up/down keys. The scrolling uses graphics.library / ScrollRaster() to move the visible text one line up/down an then fill the appropriate line at bottom/top with PrintIText.

But now I'm kinda stuck and have questions which I can't find an answer, so I ask them here:

1) Is this the right approach to display and scroll text on AmigaOS v37/2.04 or is there some more automatic solution inside the OS which I'm not aware of?

2) I'd like to go a step further and add scrollbars to the window. How can I achieve this? Do I have to set a flag/TagItem at OpenWindow or are scrollbars only possible if I'd use a SuperBitmap window? Or have the scrollbars to be manually added after opening the window?
thyslo is offline  
Old 06 October 2018, 08:57   #2
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
Hehe,
I was about to ask the same questions.
I asked already for this somewhere else (but have not started writing yet my own program) and I know I could use:
ClearEOL(), ClearScreen(), SetWriteMask() (to speed up a little), DoHookClipRects() ( advanced), ScrollWindowRaster()
Also I was told to use separate bitmap and then transfer everything to the window at one go.
But still don't know about scroll bars...
peceha is offline  
Old 06 October 2018, 10:27   #3
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
Scroll bars have to be added manually.

http://eab.abime.net/showthread.php?...84#post1195984
thomas is offline  
Old 06 October 2018, 17:40   #4
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
Thank you.
peceha is offline  
Old 06 October 2018, 18:14   #5
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
You might have noticed that the example uses OS 1.x methods.

In the meantime I converted the example to use OS 2.x methods (scroller2.c).

There is also an older example which adds arrow buttons beside the scroll bars (scroller3.c).
Attached Files
File Type: c scroller2.c (9.4 KB, 331 views)
File Type: c scroller3.c (8.5 KB, 262 views)
thomas is offline  
Old 06 October 2018, 19:32   #6
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
These examples are very helpful - everything in one place.
Great !!
peceha is offline  
Old 07 October 2018, 18:47   #7
thyslo
Registered User
 
Join Date: Apr 2018
Location: Germany
Posts: 189
Many thanks for the examples:-)
thyslo is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Making a Cracktro-Like Text Scrolling Effect mattbarton.exe Amiga scene 12 31 May 2022 21:12
Amiga Emulation Beginner: Questions beaglelover New to Emulation or Amiga scene 1 18 February 2016 04:11
Intuition paints its Gadgets over my Window Borders AGS Coders. System 0 08 January 2014 17:50
Intuition window WinAPI integration? Mequa support.WinUAE 10 12 November 2010 21:46
5 more beginner questions ( A 3000) amiganer support.Hardware 20 15 August 2007 07:45

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 14:58.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.12356 seconds with 14 queries